/*! Methalo - (c) 2026 Ernest Mokwena. All rights reserved. Unauthorised copying, reverse engineering or redistribution of this file is prohibited. */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
            background: #111111;
            color: #f2f2f2;
            height: 100vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            user-select: none;
            -webkit-user-select: none;
            -webkit-touch-callout: none;
        }
        input,
        textarea,
        select,
        [contenteditable="true"] {
            user-select: text;
            -webkit-user-select: text;
            -webkit-touch-callout: default;
        }
        .material-symbols-outlined {
            font-family: 'Material Symbols Outlined';
            font-weight: normal;
            font-style: normal;
            font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
            font-size: 18px;
            line-height: 1;
            vertical-align: middle;
            user-select: none;
            display: inline-block;
        }
        .icon-fill {
            font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
        }
        .toolbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 1rem;
            background: #111111;
            border-bottom: 1px solid #2a2a2a;
            flex-shrink: 0;
            height: 52px;
            position: relative;
            z-index: 1000;
        }
        .toolbar-left {
            display: flex;
            align-items: center;
            gap: 0.25rem;
            flex-wrap: nowrap;
        }
        .app-title {
            display: flex;
            align-items: center;
            gap: 0.4rem;
            font-weight: 600;
            font-size: 0.9rem;
            color: #f5f5f5;
            margin-right: 1rem;
        }
        .app-title { gap: 1px; align-items: flex-end; font-weight: 800; letter-spacing: -0.04em; font-size: 1.05rem; line-height: 0.75; }
        .app-mark { flex: none; display: block; }
        .app-title .material-symbols-outlined {
            color: #a3a3a3;
            font-size: 20px;
        }
        .toolbar-divider {
            width: 1px;
            height: 24px;
            background: #262f45;
            margin: 0 0.5rem;
        }
        .tool-btn {
            background: transparent;
            color: #94a3b8;
            border: none;
            padding: 0.4rem 0.7rem;
            border-radius: 6px;
            font-size: 1rem;
            cursor: pointer;
            transition: all 0.15s;
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            font-family: inherit;
            font-weight: 500;
        }
        .tool-btn:hover {
            background: #1e293b;
            color: #f1f5f9;
        }
        .tool-btn.active {
            background: rgba(255, 255, 255, 0.08);
            color: #f5f5f5;
        }
        .tool-btn.active .material-symbols-outlined {
            color: #d4d4d4;
        }
        .trigger-picker {
            min-width: 94px;
        }
        .trigger-icon-picker {
            position: fixed;
            top: 92px;
            left: 570px;
            display: none;
            flex-direction: column;
            width: 420px;
            max-height: calc(100vh - 74px);
            padding: 10px;
            gap: 8px;
            overflow: hidden;
            background: rgba(22, 22, 22, 0.76);
            border: 1px solid rgba(255, 255, 255, 0.16);
            border-radius: 12px;
            box-shadow: 0 22px 55px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
            backdrop-filter: blur(20px) saturate(125%);
            -webkit-backdrop-filter: blur(20px) saturate(125%);
            z-index: 1500;
        }
        .trigger-icon-picker.active {
            display: flex;
        }
        .trigger-icon-picker-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0;
        }
        .trigger-icon-title {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            color: #f2f2f2;
            font-size: 0.78rem;
            font-weight: 700;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }
        .trigger-icon-title .material-symbols-outlined {
            color: #bdbdbd;
            font-size: 16px;
        }
        .trigger-icon-search-wrap {
            display: flex;
            align-items: center;
            gap: 7px;
            min-height: 32px;
            padding: 0 8px;
            border: 1px solid rgba(255, 255, 255, 0.14);
            border-radius: 7px;
            background: rgba(0, 0, 0, 0.2);
            color: #a3a3a3;
        }
        .trigger-icon-search-wrap:focus-within {
            border-color: rgba(255, 255, 255, 0.42);
            box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.07);
        }
        .trigger-icon-search-wrap .material-symbols-outlined {
            font-size: 16px;
        }
        #triggerIconSearch {
            width: 100%;
            min-width: 0;
            border: 0;
            outline: 0;
            background: transparent;
            color: #f5f5f5;
            font: inherit;
            font-size: 0.76rem;
        }
        #triggerIconSearch::placeholder {
            color: #a3a3a3;
        }
        .trigger-icon-result-count {
            min-height: 13px;
            color: #8f8f8f;
            font-size: 0.65rem;
        }
        .trigger-icon-empty {
            grid-column: 1 / -1;
            padding: 24px 8px;
            color: #8f8f8f;
            text-align: center;
            font-size: 0.76rem;
        }
        .trigger-icon-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 8px;
            max-height: 420px;
            overflow-y: auto;
            padding-right: 2px;
        }
        .trigger-icon-option {
            display: flex;
            align-items: center;
            justify-content: center;
            aspect-ratio: 1;
            min-height: 68px;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.11);
            border-radius: 8px;
            color: #d4d4d4;
            cursor: pointer;
            transition: all 0.15s ease;
            font-size: 34px;
        }
        .trigger-icon-option:hover {
            background: rgba(255, 255, 255, 0.12);
            border-color: rgba(255, 255, 255, 0.35);
            color: #f5f5f5;
        }
        .trigger-icon-option.active {
            background: rgba(255, 255, 255, 0.18);
            border-color: rgba(255, 255, 255, 0.5);
            color: #ffffff;
        }
        .trigger-icon-option .material-symbols-outlined {
            font-size: inherit;
        }
        .trigger-icon-option img {
            width: 34px;
            height: 34px;
            object-fit: contain;
        }
        .trigger-content {
            font-size: inherit;
        }
        .trigger-content[src] {
            width: 1em;
            height: 1em;
            object-fit: contain;
        }
        .font-panel {
            position: fixed;
            top: 92px;
            left: 190px;
            display: none;
            flex-direction: column;
            width: 360px;
            max-height: calc(100vh - 74px);
            padding: 10px;
            gap: 8px;
            overflow: hidden;
            background: rgba(22, 22, 22, 0.76);
            border: 1px solid rgba(255, 255, 255, 0.16);
            border-radius: 12px;
            box-shadow: 0 22px 55px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
            backdrop-filter: blur(20px) saturate(125%);
            -webkit-backdrop-filter: blur(20px) saturate(125%);
            z-index: 1500;
        }
        .font-panel.active {
            display: flex;
        }
        .font-panel-header,
        .font-panel-row,
        .font-panel-case-row {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .font-panel-header {
            justify-content: space-between;
        }
        .font-panel-title {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            color: #f2f2f2;
            font-size: 0.78rem;
            font-weight: 700;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }
        .font-panel-title .material-symbols-outlined {
            color: #bdbdbd;
            font-size: 16px;
        }
        .font-panel-empty {
            padding: 18px 8px;
            color: #a3a3a3;
            font-size: 0.76rem;
            text-align: center;
        }
        .font-panel-controls {
            display: none;
            flex-direction: column;
            gap: 8px;
            min-height: 0;
        }
        .font-panel.has-selection .font-panel-empty {
            display: none;
        }
        .font-panel.has-selection .font-panel-controls {
            display: flex;
        }
        .font-panel-preview {
            min-height: 58px;
            padding: 10px 12px;
            overflow: hidden;
            border: 1px solid rgba(255, 255, 255, 0.13);
            border-radius: 7px;
            background: rgba(255, 255, 255, 0.045);
            color: #f5f5f5;
            font-size: 2rem;
            line-height: 1.15;
            white-space: nowrap;
            text-overflow: ellipsis;
        }
        .font-panel-preview,
        .font-panel-option {
            color: #f5f5f5 !important;
        }
        .font-panel-search-wrap {
            display: flex;
            align-items: center;
            gap: 7px;
            min-height: 32px;
            padding: 0 8px;
            border: 1px solid rgba(255, 255, 255, 0.14);
            border-radius: 7px;
            background: rgba(0, 0, 0, 0.2);
            color: #a3a3a3;
        }
        .font-panel-search-wrap:focus-within {
            border-color: rgba(255, 255, 255, 0.42);
            box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.07);
        }
        .font-panel-search-wrap .material-symbols-outlined {
            font-size: 16px;
        }
        #fontPanelSearch {
            width: 100%;
            min-width: 0;
            border: 0;
            outline: 0;
            background: transparent;
            color: #f5f5f5;
            font: inherit;
            font-size: 0.76rem;
        }
        .font-panel-result-count {
            min-height: 13px;
            color: #8f8f8f;
            font-size: 0.65rem;
        }
        .font-panel-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 5px;
            max-height: 210px;
            overflow-y: auto;
            padding-right: 2px;
        }
        .font-panel-all-button {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            min-height: 32px;
            border: 1px solid rgba(255, 255, 255, 0.18);
            border-radius: 6px;
            background: rgba(255, 255, 255, 0.07);
            color: #f5f5f5;
            cursor: pointer;
            font: inherit;
            font-size: 0.72rem;
            font-weight: 600;
        }
        .font-panel-all-button:hover {
            background: rgba(255, 255, 255, 0.14);
            border-color: rgba(255, 255, 255, 0.36);
        }
        .font-panel-all-button .material-symbols-outlined {
            font-size: 16px;
        }
        .all-fonts-overlay {
            position: fixed;
            inset: 0;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 28px;
            background: rgba(0, 0, 0, 0.52);
            z-index: 2200;
        }
        .all-fonts-overlay.active {
            display: flex;
        }
        .all-fonts-panel {
            display: flex;
            flex-direction: column;
            width: min(900px, 100%);
            height: min(720px, 100%);
            padding: 16px;
            gap: 12px;
            overflow: hidden;
            background: rgba(22, 22, 22, 0.86);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 14px;
            box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(24px) saturate(125%);
            -webkit-backdrop-filter: blur(24px) saturate(125%);
        }
        .all-fonts-search-wrap {
            display: flex;
            align-items: center;
            gap: 8px;
            min-height: 40px;
            padding: 0 11px;
            border: 1px solid rgba(255, 255, 255, 0.16);
            border-radius: 8px;
            background: rgba(0, 0, 0, 0.22);
            color: #a3a3a3;
        }
        .all-fonts-search-wrap:focus-within {
            border-color: rgba(255, 255, 255, 0.46);
            box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.07);
        }
        .all-fonts-search-wrap .material-symbols-outlined {
            font-size: 18px;
        }
        #allFontsSearch {
            width: 100%;
            border: 0;
            outline: 0;
            background: transparent;
            color: #f5f5f5;
            font: inherit;
            font-size: 0.84rem;
        }
        .all-fonts-groups { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 8px; }
        .all-fonts-group { padding: 5px 11px; border: 1px solid var(--theme-border); border-radius: 999px; background: transparent; color: inherit; font: 500 0.78rem Inter, Arial, sans-serif; cursor: pointer; }
        .all-fonts-group:hover { background: rgba(255, 255, 255, 0.06); }
        .all-fonts-group.active { border-color: #0d99ff; background: #0d99ff; color: #fff; }
        .all-fonts-result-count {
            color: #a3a3a3;
            font-size: 0.7rem;
        }
        .all-fonts-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            align-content: start;
            gap: 8px;
            min-height: 0;
            overflow-y: auto;
            padding-right: 4px;
        }
        .all-font-option {
            min-width: 0;
            min-height: 52px;
            padding: 10px;
            overflow: hidden;
            border: 1px solid rgba(255, 255, 255, 0.11);
            border-radius: 7px;
            background: rgba(255, 255, 255, 0.04);
            color: #f5f5f5;
            cursor: pointer;
            font-size: 0.86rem;
            text-align: left;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .font-panel-category {
            grid-column: 1 / -1;
            padding: 5px 2px 1px;
            color: #8f8f8f;
            font-size: 0.62rem;
            font-weight: 700;
            letter-spacing: 0.08em;
            text-transform: uppercase;
        }
        .all-font-option:hover,
        .all-font-option.active {
            background: rgba(255, 255, 255, 0.14);
            border-color: rgba(255, 255, 255, 0.4);
        }
        .all-fonts-load-more {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 7px;
            min-height: 34px;
            border: 1px solid rgba(255, 255, 255, 0.18);
            border-radius: 7px;
            background: rgba(255, 255, 255, 0.07);
            color: #f5f5f5;
            cursor: pointer;
            font: inherit;
            font-size: 0.72rem;
            font-weight: 600;
        }
        .all-fonts-retry {
            display: none;
            align-items: center;
            justify-content: center;
            gap: 7px;
            min-height: 34px;
            border: 1px solid rgba(255, 255, 255, 0.18);
            border-radius: 7px;
            background: rgba(255, 255, 255, 0.07);
            color: #f5f5f5;
            cursor: pointer;
            font: inherit;
            font-size: 0.72rem;
            font-weight: 600;
        }
        .all-fonts-retry.active {
            display: inline-flex;
        }
        .all-fonts-retry:hover {
            background: rgba(255, 255, 255, 0.14);
            border-color: rgba(255, 255, 255, 0.36);
        }
        .all-fonts-load-more:hover:not(:disabled) {
            background: rgba(255, 255, 255, 0.14);
            border-color: rgba(255, 255, 255, 0.36);
        }
        .all-fonts-load-more:disabled {
            opacity: 0.72;
            cursor: wait;
        }
        .all-fonts-load-more .material-symbols-outlined {
            font-size: 16px;
        }
        .all-fonts-load-more.loading .material-symbols-outlined {
            animation: font-library-spin 0.9s linear infinite;
        }
        @keyframes font-library-spin {
            to { transform: rotate(360deg); }
        }
        @media (max-width: 720px) {
            .all-fonts-overlay {
                padding: 10px;
            }
            .all-fonts-panel {
                height: min(760px, 100%);
                padding: 12px;
            }
            .all-fonts-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
        }
        .font-panel-option {
            min-width: 0;
            padding: 8px;
            overflow: hidden;
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 6px;
            background: rgba(255, 255, 255, 0.035);
            color: #d8d8d8;
            cursor: pointer;
            font-size: 0.78rem;
            text-align: left;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .font-panel-option:hover,
        .font-panel-option.active {
            background: rgba(255, 255, 255, 0.13);
            border-color: rgba(255, 255, 255, 0.34);
            color: #ffffff;
        }
        .font-panel-divider {
            border-top: 1px solid rgba(255, 255, 255, 0.1);
        }
        .font-panel-row > label,
        .font-panel-case-row > label {
            flex: 1;
            min-width: 0;
            color: #a3a3a3;
            font-size: 0.68rem;
        }
        .font-panel-row input,
        .font-panel-row select,
        .font-panel-case-row select,
        .font-panel-case-row input {
            display: block;
            width: 100%;
            min-height: 30px;
            margin-top: 4px;
            padding: 5px 7px;
            border: 1px solid rgba(255, 255, 255, 0.14);
            border-radius: 6px;
            background: rgba(0, 0, 0, 0.2);
            color: #eeeeee;
            font: inherit;
            font-size: 0.74rem;
        }
        .font-panel select {
            appearance: none;
            -webkit-appearance: none;
            background-color: rgba(255, 255, 255, 0.06);
            background-image: linear-gradient(45deg, transparent 50%, #a3a3a3 50%), linear-gradient(135deg, #a3a3a3 50%, transparent 50%);
            background-position: calc(100% - 12px) 13px, calc(100% - 8px) 13px;
            background-size: 4px 4px, 4px 4px;
            background-repeat: no-repeat;
            padding-right: 24px;
            cursor: pointer;
        }
        .font-panel select:hover {
            background-color: rgba(255, 255, 255, 0.1);
            border-color: rgba(255, 255, 255, 0.28);
        }
        .font-panel select:focus,
        .font-panel input:focus {
            outline: none;
            border-color: rgba(255, 255, 255, 0.42);
            box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.07);
        }
        .font-panel select option {
            background: #262626;
            color: #f5f5f5;
        }
        .font-panel-case-row input[type="color"] {
            padding: 2px;
            cursor: pointer;
        }
        .font-panel-actions {
            display: flex;
            gap: 5px;
        }
        .font-panel-actions button {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 32px;
            height: 30px;
            padding: 0;
            border: 1px solid rgba(255, 255, 255, 0.14);
            border-radius: 6px;
            background: rgba(255, 255, 255, 0.045);
            color: #d5d5d5;
            cursor: pointer;
        }
        .font-panel-actions button:hover,
        .font-panel-actions button.active {
            background: rgba(255, 255, 255, 0.15);
            border-color: rgba(255, 255, 255, 0.4);
            color: #ffffff;
        }
        @media (max-width: 620px) {
            .font-panel {
                left: 8px;
                right: 8px;
                width: auto;
            }
        }
        .overflow-toggle {
            min-width: 100px;
        }
        .overflow-toggle.active {
            background: rgba(163, 163, 163, 0.35);
            color: #f8fafc;
        }
        .zoom-controls {
            display: inline-flex;
            align-items: center;
            gap: 0.2rem;
            margin-left: 0.2rem;
        }
        .zoom-btn {
            min-width: 32px;
            justify-content: center;
            padding: 0.4rem 0.55rem;
            font-size: 0.82rem;
            font-weight: 700;
        }
        .zoom-btn .material-symbols-outlined {
            font-size: 16px;
        }
        .creation-rail {
            width: 52px;
            flex: 0 0 52px;
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 4px;
            padding: 10px 8px;
            background: #111111;
            border-right: 1px solid #2a2a2a;
            z-index: 10;
        }
        .creation-rail .tool-btn {
            position: relative;
            width: 36px;
            min-width: 0;
            min-height: 36px;
            padding: 0.45rem;
            justify-content: center;
        }
        .creation-rail .tool-label {
            position: absolute;
            left: calc(100% + 12px);
            top: 50%;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 5px 9px;
            border: 1px solid #3a3a3a;
            border-radius: 6px;
            background: #232323;
            color: #f5f5f5;
            font-size: 0.75rem;
            font-weight: 600;
            line-height: 1.2;
            white-space: nowrap;
            box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
            pointer-events: none;
            opacity: 0;
            transform: translate(-4px, -50%);
            transition: opacity 0.1s ease, transform 0.12s ease;
            z-index: 30;
        }
        .creation-rail .material-symbols-outlined { flex: none; width: 1em; overflow: hidden; }
        .creation-rail .tool-label kbd {
            min-width: 18px;
            padding: 1px 5px;
            border: 1px solid #4a4a4a;
            border-radius: 4px;
            color: #a3a3a3;
            font: inherit;
            font-size: 0.68rem;
            text-align: center;
        }
        .creation-rail .tool-btn:hover .tool-label,
        .creation-rail .tool-btn:focus-visible .tool-label,
        .creation-rail:not(.colours-open) .page-colours:hover > .tool-label {
            opacity: 1;
            transform: translate(0, -50%);
        }
        .page-colours {
            margin-top: auto;
            display: flex;
            align-items: center;
            gap: 10px;
            padding-top: 10px;
            border-top: 1px solid #2a2a2a;
            position: relative;
        }
        .page-swatches { position: relative; flex: 0 0 36px; width: 36px; height: 38px; }
        .page-swatch {
            position: absolute;
            width: 22px;
            height: 22px;
            padding: 0;
            border: 2px solid #111111;
            border-radius: 5px;
            background: var(--swatch, #ffffff);
            box-shadow: 0 0 0 1px #525252;
            cursor: pointer;
        }
        .page-swatch.is-text { left: 0; top: 0; z-index: 1; display: grid; place-items: center; }
        .page-swatch.is-text span {
            font: 700 11px/1 Inter, Arial, sans-serif;
            color: var(--swatch, #1e293b);
            filter: invert(1) grayscale(1) contrast(9); 
        }
        .page-swatch.is-background { right: 0; bottom: 0; }
        .page-swatch:hover, .page-swatch.open { box-shadow: 0 0 0 2px #38bdf8; z-index: 2; }
        .page-colour-mini {
            position: absolute;
            display: grid;
            place-items: center;
            width: 13px;
            height: 13px;
            padding: 0;
            border: 0;
            background: none;
            color: #8a8a8a;
            cursor: pointer;
        }
        .page-colour-mini .material-symbols-outlined { font-size: 13px; }
        .page-colour-mini:hover { color: #ffffff; }
        .page-colour-mini.is-swap { right: 0; top: 0; }
        .page-colour-mini.is-reset { left: 0; bottom: 0; }
        .bar-colour-pop.page-colour-pop { position: fixed; top: auto; right: auto; z-index: 1200; } 
        .page-pop-hint { margin: 6px 0 0; font: 0.68rem/1.35 Inter, Arial, sans-serif; color: #8a8a8a; }
        .overlay-panel-style .page-pop-hint { margin: 0 0 10px; }
        .experiment-panel {
            position: fixed;
            display: none;
            flex-direction: column;
            gap: 0;
            min-width: 280px;
            background: #1e293b;
            border: 1px solid #334155;
            border-radius: 8px;
            padding: 6px 0;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
            z-index: 160;
        }
        .experiment-panel.active {
            display: flex;
        }
        .items-panel {
            position: fixed;
            display: none;
            flex-direction: column;
            width: min(420px, calc(100vw - 24px));
            max-height: min(620px, calc(100vh - 24px));
            overflow: auto;
            padding: 12px;
            color: #f5f5f5;
            background: rgba(24, 24, 27, 0.74);
            border: 1px solid rgba(212, 212, 216, 0.24);
            border-radius: 14px;
            box-shadow: 0 18px 38px -24px rgba(0, 0, 0, 0.92), 0 0 0 1px rgba(255, 255, 255, 0.06);
            backdrop-filter: blur(18px) saturate(125%);
            -webkit-backdrop-filter: blur(18px) saturate(125%);
            z-index: 161;
        }
        .items-panel.active {
            display: flex;
        }
        .items-panel-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            margin-bottom: 10px;
            padding-bottom: 9px;
            border-bottom: 1px solid rgba(212, 212, 216, 0.16);
        }
        .items-panel-title {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            color: #fafafa;
            font-size: 0.82rem;
            font-weight: 600;
        }
        .items-panel-title .material-symbols-outlined {
            color: #d4d4d8;
            font-size: 18px;
        }
        .items-panel .prop-section {
            margin-bottom: 0.8rem;
            padding-bottom: 0.7rem;
            border-bottom-color: rgba(212, 212, 216, 0.15);
        }
        .items-panel .prop-group input,
        .items-panel .prop-group select {
            background: rgba(24, 24, 27, 0.72);
            border-color: rgba(212, 212, 216, 0.22);
        }
        .items-panel input[type="text"],
        .items-panel input[type="url"],
        .items-panel input[type="number"],
        .items-panel select {
            width: 100%;
            min-width: 0;
            box-sizing: border-box;
            padding: 0.48rem 0.6rem;
            color: #f4f4f5;
            background: rgba(24, 24, 27, 0.72);
            border: 1px solid rgba(212, 212, 216, 0.22);
            border-radius: 6px;
            outline: none;
            font: inherit;
            font-size: 0.76rem;
            transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
        }
        .items-panel input[type="text"]::placeholder,
        .items-panel input[type="url"]::placeholder {
            color: #71717a;
        }
        .items-panel input[type="text"]:focus,
        .items-panel input[type="url"]:focus,
        .items-panel input[type="number"]:focus,
        .items-panel select:focus {
            background: rgba(39, 39, 42, 0.86);
            border-color: rgba(244, 244, 245, 0.6);
            box-shadow: 0 0 0 2px rgba(244, 244, 245, 0.08);
        }
        .items-panel input[type="number"] {
            -moz-appearance: textfield;
            appearance: textfield;
        }
        .items-panel input[type="number"]::-webkit-outer-spin-button,
        .items-panel input[type="number"]::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }
        .items-panel input[type="color"] {
            width: 100%;
            height: 32px;
            padding: 3px;
            border: 1px solid rgba(212, 212, 216, 0.22);
            border-radius: 6px;
            background: rgba(24, 24, 27, 0.72);
            cursor: pointer;
        }
        .items-panel input[type="checkbox"] {
            width: 15px;
            height: 15px;
            margin: 0;
            accent-color: #d4d4d8;
            cursor: pointer;
        }
        .items-panel .items-detail-row {
            background: rgba(24, 24, 27, 0.5);
            border-color: rgba(212, 212, 216, 0.16);
        }
        .items-panel .items-anchor-toggle {
            background: rgba(212, 212, 216, 0.07);
            border-color: rgba(212, 212, 216, 0.2);
        }
        .prototype-preview-panel {
            position: fixed;
            display: none;
            flex-direction: column;
            gap: 0.7rem;
            min-width: 260px;
            max-width: 320px;
            background: rgba(15, 23, 42, 0.72);
            border: 1px solid rgba(148, 163, 184, 0.26);
            border-radius: 14px;
            box-shadow: 0 18px 38px -24px rgba(15, 23, 42, 0.9), 0 0 0 1px rgba(148, 163, 184, 0.08);
            backdrop-filter: blur(14px) saturate(160%);
            -webkit-backdrop-filter: blur(14px) saturate(160%);
            padding: 10px 12px 12px;
            z-index: 160;
        }
        .prototype-preview-panel.active {
            display: flex;
        }
        .prototype-preview-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
        }
        .prototype-preview-title {
            display: inline-flex;
            align-items: center;
            gap: 0.45rem;
            font-size: 0.82rem;
            font-weight: 600;
            color: #f8fafc;
        }
        .prototype-preview-title .material-symbols-outlined {
            font-size: 16px;
            color: #94a3b8;
        }
        .prototype-preview-list {
            display: flex;
            flex-direction: column;
            gap: 0.65rem;
        }
        .prototype-preview-item {
            border: 1px solid rgba(148, 163, 184, 0.18);
            background: rgba(15, 23, 42, 0.32);
            border-radius: 12px;
            padding: 8px 8px 7px;
        }
        .prototype-preview-name {
            font-size: 0.74rem;
            color: #e2e8f0;
            margin-bottom: 0.55rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 0.4rem;
        }
        .prototype-preview-name::before {
            content: "";
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #f59e0b;
            display: inline-block;
            box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.16);
        }
        .prototype-preview-route {
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .prototype-state-pill {
            border: 1px solid rgba(148, 163, 184, 0.2);
            background: rgba(15, 23, 42, 0.32);
            color: #e2e8f0;
            padding: 5px 8px;
            border-radius: 8px;
            min-width: 52px;
            cursor: pointer;
            font-size: 0.72rem;
            font-family: inherit;
            transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
        }
        .prototype-state-pill:hover {
            transform: translateY(-1px);
            border-color: rgba(245, 158, 11, 0.7);
        }
        .prototype-state-pill.active {
            background: #f59e0b;
            border-color: #f59e0b;
            color: #111827;
            font-weight: 700;
        }
        .prototype-wire {
            flex: 1;
            height: 2px;
            background: linear-gradient(90deg, rgba(148, 163, 184, 0.35), rgba(245, 158, 11, 0.8), rgba(148, 163, 184, 0.35));
            border-radius: 999px;
            position: relative;
            min-width: 26px;
        }
        .prototype-wire::before,
        .prototype-wire::after {
            content: "";
            position: absolute;
            top: 50%;
            width: 7px;
            height: 7px;
            border-radius: 50%;
            transform: translateY(-50%);
            background: rgba(245, 158, 11, 0.85);
        }
        .prototype-wire::before { left: 0; }
        .prototype-wire::after { right: 0; }
        .prototype-empty {
            padding: 0.45rem 0.2rem;
            color: #94a3b8;
            font-size: 0.76rem;
        }
        .prototype-node-stack {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            padding: 0.1rem 0;
        }
        .prototype-node {
            display: grid;
            grid-template-columns: 1fr auto 1fr;
            align-items: center;
            gap: 0.5rem;
        }
        .prototype-node-label {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 28px;
            padding: 0.4rem 0.6rem;
            border-radius: 8px;
            border: 1px solid rgba(148, 163, 184, 0.18);
            background: rgba(15, 23, 42, 0.24);
            color: #e2e8f0;
            font-size: 0.72rem;
            font-weight: 600;
        }
        .prototype-node-label.active {
            border-color: rgba(245, 158, 11, 0.8);
            background: rgba(245, 158, 11, 0.12);
            color: #fef3c7;
        }
        .prototype-node-wire {
            height: 2px;
            background: linear-gradient(90deg, rgba(148, 163, 184, 0.2), rgba(245, 158, 11, 0.8), rgba(148, 163, 184, 0.2));
            border-radius: 999px;
            position: relative;
        }
        .prototype-node-wire::before,
        .prototype-node-wire::after {
            content: "";
            position: absolute;
            top: 50%;
            width: 6px;
            height: 6px;
            border-radius: 50%;
            transform: translateY(-50%);
            background: rgba(245, 158, 11, 0.8);
        }
        .prototype-node-wire::before { left: 0; }
        .prototype-node-wire::after { right: 0; }
        .experiment-panel-title {
            padding: 8px 14px 10px;
            font-size: 0.84rem;
            letter-spacing: 0;
            text-transform: none;
            color: #e2e8f0;
            font-weight: 600;
            display: inline-flex;
            align-items: center;
            gap: 0.45rem;
        }
        .experiment-panel-title .material-symbols-outlined {
            font-size: 16px;
            color: #94a3b8;
        }
        .experiment-row {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 0.45rem;
            padding: 0 14px 10px;
        }
        .experiment-label {
            color: #94a3b8;
            font-size: 0.72rem;
            font-weight: 500;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }
        .experiment-height-controls {
            display: grid;
            grid-template-columns: 30px 1fr auto 30px;
            align-items: center;
            gap: 0.4rem;
        }
        .experiment-height-btn {
            border: 1px solid #334155;
            background: #0f172a;
            color: #e2e8f0;
            width: 30px;
            height: 30px;
            border-radius: 6px;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            line-height: 1;
            font-family: inherit;
        }
        .experiment-height-btn:hover {
            background: #1e293b;
            border-color: #475569;
        }
        .experiment-height-input {
            border: 1px solid #334155;
            background: #0f172a;
            color: #f8fafc;
            border-radius: 6px;
            padding: 0.4rem 0.55rem;
            min-height: 30px;
            font-size: 0.82rem;
            text-align: right;
            font-family: inherit;
        }
        .experiment-height-input:focus {
            outline: 1px solid #a3a3a3;
            border-color: #a3a3a3;
        }
        .experiment-height-input[type="number"] {
            -moz-appearance: textfield;
            appearance: textfield;
        }
        .experiment-height-input[type="number"]::-webkit-outer-spin-button,
        .experiment-height-input[type="number"]::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }
        .experiment-height-unit {
            color: #94a3b8;
            font-size: 0.76rem;
            min-width: 18px;
            text-align: center;
        }
        .experiment-divider {
            height: 1px;
            background: #334155;
            margin: 0;
        }
        .experiment-stack {
            display: flex;
            flex-direction: column;
            gap: 0.55rem;
            padding: 10px 14px 4px;
        }
        .experiment-breakpoint-list {
            display: flex;
            flex-direction: column;
            gap: 0.3rem;
            max-height: 220px;
            overflow-y: auto;
        }
        .experiment-breakpoint-chip {
            border: 1px solid #334155;
            background: #0f172a;
            color: #e2e8f0;
            border-radius: 6px;
            padding: 0.45rem 0.65rem;
            font-size: 0.78rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.5rem;
            cursor: pointer;
            transition: background 0.12s, border-color 0.12s, color 0.12s;
        }
        .experiment-breakpoint-chip:hover {
            background: #172235;
            border-color: #475569;
        }
        .experiment-breakpoint-chip.active {
            border-color: #a3a3a3;
            background: rgba(163, 163, 163, 0.18);
            color: #f5f3ff;
        }
        .experiment-breakpoint-remove {
            border: none;
            background: transparent;
            color: #94a3b8;
            font-size: 0.82rem;
            width: 20px;
            height: 20px;
            line-height: 1;
            cursor: pointer;
            padding: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
        }
        .experiment-breakpoint-remove .material-symbols-outlined {
            font-size: 16px;
            line-height: 1;
        }
        .experiment-breakpoint-remove:hover {
            color: #f8fafc;
            background: rgba(255, 255, 255, 0.06);
        }
        .experiment-breakpoint-add {
            display: grid;
            grid-template-columns: 1fr auto;
            align-items: center;
            gap: 0.45rem;
        }
        .experiment-breakpoint-input {
            width: 100%;
            border: 1px solid #334155;
            background: #0f172a;
            color: #f8fafc;
            border-radius: 6px;
            padding: 0.42rem 0.55rem;
            min-height: 30px;
            font-size: 0.8rem;
            font-family: inherit;
        }
        .experiment-breakpoint-input:focus {
            outline: 1px solid #a3a3a3;
            border-color: #a3a3a3;
        }
        .experiment-breakpoint-input[type="number"] {
            -moz-appearance: textfield;
            appearance: textfield;
        }
        .experiment-breakpoint-input[type="number"]::-webkit-outer-spin-button,
        .experiment-breakpoint-input[type="number"]::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }
        .experiment-breakpoint-add-btn {
            border: 1px solid #334155;
            background: #0f172a;
            color: #e2e8f0;
            border-radius: 6px;
            padding: 0.42rem 0.7rem;
            font-size: 0.76rem;
            cursor: pointer;
            font-family: inherit;
            white-space: nowrap;
            min-height: 30px;
        }
        .experiment-breakpoint-add-btn:hover {
            background: #172235;
            border-color: #475569;
        }
        .canvas-screen-handle {
            position: absolute;
            top: 10px;
            transform: translateX(-50%);
            border: 1px solid rgba(255, 255, 255, 0.35);
            background: rgba(17, 17, 17, 0.85);
            color: #f5f5f5;
            border-radius: 999px;
            padding: 3px 8px;
            font-size: 11px;
            line-height: 1;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            cursor: grab;
            pointer-events: auto;
            user-select: none;
            touch-action: none;
            z-index: 770;
        }
        .canvas-screen-handle:active {
            cursor: grabbing;
        }
        .canvas-screen-handle .material-symbols-outlined {
            font-size: 14px;
            line-height: 1;
        }
        .tool-btn:disabled {
            opacity: 0.35;
            cursor: not-allowed;
        }
        .tool-btn:disabled:hover {
            background: transparent;
            color: #94a3b8;
        }
        .tool-btn .material-symbols-outlined {
            font-size: 18px;
        }
        .toolbar-right {
            display: flex;
            align-items: center;
            gap: 0.35rem;
        }
        .export-btn {
            background: #262626;
            color: #f2f2f2;
            padding: 0.45rem 1.1rem;
            border-radius: 6px;
            font-weight: 600;
            border: 1px solid #595959;
        }
        .export-btn:hover {
            background: #303030;
            color: #f2f2f2;
            border-color: #6a6a6a;
        }
        .top-tabs {
            display: flex;
            align-items: center;
            gap: 0.35rem;
            padding: 0 1rem;
            background: #111111;
            border-bottom: 1px solid #2a2a2a;
            min-height: 34px;
            flex-shrink: 0;
            position: relative;
            z-index: 100;
        }
        .file-menu-wrapper {
            position: relative;
            display: inline-flex;
            align-items: center;
        }
        .file-menu-button {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            padding: 0.45rem 0.8rem;
            border-radius: 6px;
            background: rgba(38, 38, 38, 0.7);
            color: var(--theme-text);
            border: 1px solid var(--theme-border);
            box-shadow: inset 0 1px 0 var(--theme-glow);
            cursor: pointer;
            font-size: 0.82rem;
            font-weight: 700;
        }
        .file-menu-button:hover {
            background: rgba(50, 50, 50, 0.9);
        }
        .file-menu-button.active,
        .file-menu-button[data-open="true"],
        #fileMenuButton[aria-expanded="true"] {
            background: rgba(38, 38, 38, 0.95);
            border-color: var(--theme-border);
            border-bottom-color: transparent;
            border-radius: 6px 6px 0 0;
            box-shadow: inset 0 1px 0 var(--theme-glow);
            margin-bottom: -1px;
            color: var(--theme-text);
        }
        .file-menu-button .material-symbols-outlined {
            font-size: 16px;
            color: var(--theme-subtle);
        }
        .file-menu {
            position: absolute;
            top: calc(100% - 1px);
            left: 0;
            min-width: 160px;
            background: rgba(38, 38, 38, 0.95);
            border: 1px solid var(--theme-border);
            border-radius: 0 6px 6px 6px;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), inset 0 1px 0 var(--theme-glow);
            padding: 4px 0;
            display: flex;
            flex-direction: column;
            z-index: 1200;
        }
        .file-menu.hidden {
            display: none;
        }
        .file-menu-item {
            width: 100%;
            text-align: left;
            background: transparent;
            border: none;
            color: var(--theme-text);
            padding: 8px 16px;
            cursor: pointer;
            font-size: 0.85rem;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 0.6rem;
            transition: background 0.1s;
        }
        .file-menu-item .material-symbols-outlined {
            font-size: 17px;
            color: var(--theme-subtle);
        }
        .file-menu-item:hover {
            background: rgba(89, 89, 89, 0.26);
        }
        .tab-item {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            padding: 0.45rem 0.75rem 0.45rem 0.8rem;
            border-radius: 5px 5px 0 0;
            background: transparent;
            color: #94a3b8;
            border: 1px solid transparent;
            border-bottom: 1px solid transparent;
            cursor: pointer;
            transition: background 0.15s, color 0.15s;
            font-size: 0.82rem;
            font-weight: 600;
            position: relative;
        }
        .tab-item:hover {
            background: rgba(255, 255, 255, 0.04);
            color: #e7eaf6;
        }
        .tab-item.active {
            background: #1b1b1b;
            color: #f5f5f5;
            border-color: #2a2a2a #2a2a2a transparent #2a2a2a;
            border-bottom-color: transparent;
        }
        .tab-item .material-symbols-outlined {
            font-size: 16px;
        }
        .tab-label {
            display: inline-block;
            line-height: 1;
        }
        .tab-close-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            font-size: 0.95rem;
            line-height: 1;
            color: #cbd5e1;
            opacity: 0.8;
            transition: background 0.12s ease, opacity 0.12s ease, color 0.12s ease;
            margin-left: 0.2rem;
            user-select: none;
        }
        .tab-close-btn:hover {
            background: rgba(148, 163, 184, 0.18);
            color: #ffffff;
            opacity: 1;
        }
        .tab-close-btn[hidden] {
            display: none !important;
        }
        .tab-item .tab-close-btn {
            visibility: visible;
        }
        .tab-item:has(.tab-close-btn[hidden]) .tab-close-btn {
            visibility: hidden;
        }
        .workspace-bar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 1rem;
            background: #111111;
            border-bottom: 1px solid #2a2a2a;
            min-height: 38px;
            flex-shrink: 0;
        }
        .workspace-controls {
            display: flex;
            align-items: center;
            gap: 0.65rem;
        }
        .workspace-status {
            color: #94a3b8;
            font-size: 0.76rem;
        }
        .main-area {
            display: flex;
            flex: 1;
            overflow: hidden;
        }
        .canvas-wrapper {
            flex: 1;
            background: #0f172a;
            padding: 0;
            overflow: scroll;
            position: relative;
            display: block;
            scrollbar-gutter: stable both-edges;
        }
        .canvas {
            width: 900px;
            height: 600px;
            background: #ffffff;
            border-radius: 8px;
            position: relative;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
            overflow: hidden;
            margin: clamp(220px, 40vw, 620px) clamp(220px, 40vw, 620px) clamp(140px, 24vh, 380px);
        }
        .canvas-resize-tip {
            position: absolute;
            left: 50%;
            bottom: 8px;
            transform: translateX(-50%);
            width: 64px;
            height: 14px;
            border-radius: 999px;
            border: 1px solid rgba(148, 163, 184, 0.7);
            background: rgba(15, 23, 42, 0.14);
            cursor: ns-resize;
            touch-action: none;
            z-index: 900;
        }
        .canvas-resize-tip::before {
            content: '';
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            width: 26px;
            height: 3px;
            border-radius: 999px;
            background: rgba(71, 85, 105, 0.95);
        }
        .canvas.resizing-canvas .canvas-resize-tip {
            background: rgba(163, 163, 163, 0.2);
            border-color: rgba(163, 163, 163, 0.95);
        }
        .shape-layer {
            position: absolute;
            cursor: grab;
            user-select: none;
            touch-action: none;
            border: 2px solid transparent;
            border-radius: 0;
            transition: border-color 0.08s, box-shadow 0.08s ease, opacity 0.08s ease;
        }
        .shape-layer:hover {
            border-color: #a3a3a3;
        }
        .shape-layer.prototype-group {
            transition: opacity var(--prototype-transition, 0.45s) ease, clip-path var(--prototype-transition, 0.45s) ease, border-color var(--prototype-transition, 0.45s) ease;
        }
        #canvas.live-preview .shape-layer.prototype-group:hover {
            opacity: var(--prototype-hover-opacity, 1);
            clip-path: var(--prototype-hover-clip, none);
        }
        .shape-layer.trigger-layer {
            transition: background-color var(--prototype-transition, 0.45s) ease, border-color var(--prototype-transition, 0.45s) ease, color var(--prototype-transition, 0.45s) ease, box-shadow var(--prototype-transition, 0.45s) ease;
        }
        #canvas.live-preview .shape-layer.trigger-layer:hover {
            border-color: currentColor;
            box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent);
        }
        .has-layer-hover {
            transition: opacity var(--layer-hover-duration, 0.45s) var(--layer-hover-easing, ease), background-color var(--layer-hover-duration, 0.45s) var(--layer-hover-easing, ease), color var(--layer-hover-duration, 0.45s) var(--layer-hover-easing, ease), transform var(--layer-hover-duration, 0.45s) var(--layer-hover-easing, ease);
        }
        #canvas.live-preview .has-layer-hover.hover-opacity:hover { opacity: var(--layer-hover-opacity, 1) !important; }
        #canvas.live-preview .has-layer-hover.hover-background:hover { background-color: var(--layer-hover-bg, inherit) !important; }
        #canvas.live-preview .has-layer-hover.hover-color:hover { color: var(--layer-hover-color, inherit) !important; }
        #canvas.live-preview .has-layer-hover.hover-transform:hover {
            transform: rotate(var(--layer-hover-rotation, 0deg)) scale(var(--layer-hover-scale, 1)) !important;
        }
        .prop-state-tabs {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 4px;
            margin-bottom: 0.85rem;
            padding: 3px;
            background: rgba(38, 38, 38, 0.78);
            border: 1px solid rgba(163, 163, 163, 0.22);
            border-radius: 6px;
        }
        .prop-state-tabs button {
            border: 0;
            border-radius: 4px;
            padding: 0.45rem 0.5rem;
            background: transparent;
            color: #a3a3a3;
            cursor: pointer;
        }
        .prop-state-tabs button.active,
        .prop-state-tabs button:hover {
            background: #525252;
            color: #f5f5f5;
        }
        .hover-property-row {
            display: grid;
            grid-template-columns: minmax(130px, auto) minmax(0, 1fr);
            align-items: center;
            gap: 0.6rem;
            margin-bottom: 0.55rem;
        }
        .hover-property-toggle {
            display: inline-flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.35rem;
            min-height: 30px;
            padding: 0.3rem 0.45rem;
            border: 1px solid #334155;
            border-radius: 6px;
            background: transparent;
            color: #94a3b8;
            cursor: pointer;
            font: inherit;
            font-size: 0.72rem;
            text-align: left;
        }
        .hover-property-toggle.active,
        .hover-property-toggle:hover {
            background: rgba(163, 163, 163, 0.2);
            border-color: #64748b;
            color: #f8fafc;
        }
        .hover-property-toggle .material-symbols-outlined { font-size: 20px; }
        .prop-range-value {
            display: block;
            color: #a3a3a3;
            font-size: 0.72rem;
            margin-top: 1px;
        }
        .shape-layer.selected {
            border-color: #a3a3a3;
            outline: 2px solid rgba(163, 163, 163, 0.3);
        }
        .shape-layer.hidden {
            display: none !important;
        }
        .shape-layer.dragging,
        .shape-layer.resizing {
            cursor: grabbing;
            opacity: 0.96;
            box-shadow: 0 10px 20px -8px rgba(0, 0, 0, 0.3), 0 0 0 1px #a3a3a3;
            z-index: 500;
            transition: box-shadow 0.08s ease, opacity 0.08s ease;
        }
        .shape-layer.rectangle {
            background: #737373;
        }
        .shape-layer.circle {
            border-radius: 50%;
            background: #737373;
        }
        .shape-layer.text-layer {
            background: transparent;
            border: none;
            padding: 0;
        }
        .shape-layer.text-layer:hover {
            outline: 2px dashed #a3a3a3;
            outline-offset: 2px;
        }
        .text-content {
            width: 100%;
            height: 100%;
            line-height: 1.2; 
            overflow: hidden;
            white-space: pre-wrap;
            word-break: break-word;
            overflow-wrap: anywhere;
            transform-origin: left center;
        }
        .text-content[contenteditable] {
            outline: 2px solid #a3a3a3;
            outline-offset: 2px;
            cursor: text;
            user-select: text;
            overflow: hidden;
        }
        .shape-layer.group-container {
            border: 2px dashed #f59e0b;
            background: rgba(245, 158, 11, 0.05);
        }
        .shape-layer.group-layer {
            outline: 1px dashed rgba(245, 158, 11, 0.8);
        }
        .shape-layer.group-container:hover {
            border-color: #f59e0b;
        }
        .shape-layer.group-container.selected {
            border-color: #f59e0b;
            outline: 2px solid rgba(245, 158, 11, 0.3);
        }
        .shape-layer.image-layer {
            border: none;
            background: transparent;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }
        .image-content {
            width: 100%;
            height: 100%;
            overflow: hidden;
            border-radius: inherit;
        }
        .shape-layer.image-layer img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            pointer-events: none;
            display: block;
            border-radius: inherit;
        }
        .shape-layer.component-layer {
            background: transparent;
            overflow: hidden;
        }
        .component-list {
            display: flex;
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
            list-style: none;
        }
        .component-list li {
            border-bottom: 1px solid #cccccc;
            color: inherit;
            white-space: nowrap;
        }
        .component-list a {
            color: inherit;
            text-decoration: none;
        }
        .shape-layer.component-layer .component-list {
            pointer-events: none;
        }
        .shape-layer.component-layer .component-list li {
            min-width: 0;
            min-height: 0;
            overflow: hidden;
        }
        .selection-overlay {
            position: absolute;
            pointer-events: none;
            z-index: 20;
            opacity: 1;
        }
        .selection-overlay .resize-handle,
        .selection-overlay .rotate-zone {
            pointer-events: auto;
        }
        .resize-handle {
            position: absolute;
            width: 12px;
            height: 12px;
            background: #737373;
            border: 2px solid #ffffff;
            border-radius: 3px;
            opacity: 1;
            transition: opacity 0.2s, transform 0.15s;
            touch-action: none;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
            z-index: 10;
            transform: scale(var(--inv-zoom, 1)); 
        }
        .shape-layer:hover .resize-handle,
        .shape-layer.selected .resize-handle {
            opacity: 1;
        }
        html.text-sizing, html.text-sizing * { cursor: ns-resize !important; }
        .resize-handle:active,
        .shape-layer.resizing .resize-handle {
            transform: scale(calc(1.25 * var(--inv-zoom, 1)));
        }
        .shape-layer.group-container .resize-handle {
            background: #f59e0b;
        }
        .rotate-zone {
            position: absolute;
            touch-action: none;
            z-index: 1;
            cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24'><path d='M7.11 8.53L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47zM6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47zm1.01 5.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32zM13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93z' fill='none' stroke='white' stroke-width='2.6'/><path d='M7.11 8.53L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47zM6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47zm1.01 5.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32zM13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93z' fill='%230f172a'/></svg>") 11 11, grab;
        }
        .rotate-zone:active {
            cursor: grabbing;
        }
        .shape-layer.rotating .rotate-zone {
            cursor: grabbing;
        }
        .sidebar {
            width: 320px;
            background: #0f172a;
            border-left: 1px solid #262f45;
            display: flex;
            flex-direction: column;
            flex-shrink: 0;
            overflow: hidden;
        }
        .panel {
            padding: 1rem;
            flex: 1;
            overflow-y: auto;
        }
        .panel h3 {
            font-size: 0.68rem;
            font-weight: 600;
            letter-spacing: 0.04em;
            text-transform: uppercase;
            color: #64748b;
            margin-bottom: 0.75rem;
            display: flex;
            align-items: center;
            gap: 0.35rem;
        }
        .panel h3 .material-symbols-outlined {
            font-size: 15px;
        }
        .sidebar-tabs {
            display: flex;
            border-bottom: 1px solid #262f45;
            flex-shrink: 0;
        }
        .sidebar-tab {
            flex: 1;
            background: transparent;
            border: none;
            color: #94a3b8;
            padding: 0.7rem 0.5rem;
            font-size: 0.72rem;
            font-weight: 600;
            letter-spacing: 0.03em;
            text-transform: uppercase;
            cursor: pointer;
            font-family: inherit;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.35rem;
            border-bottom: 2px solid transparent;
            transition: background 0.15s, color 0.15s, border-color 0.15s;
        }
        .sidebar-tab .material-symbols-outlined {
            font-size: 16px;
        }
        .sidebar-tab:hover {
            background: #1e293b;
            color: #f1f5f9;
        }
        .sidebar-tab.active {
            color: #f5f5f5;
            border-bottom-color: #a3a3a3;
            background: rgba(255, 255, 255, 0.06);
        }
        .layer-list {
            display: flex;
            flex-direction: column;
            gap: 4px;
            margin-bottom: 0.75rem;
            max-height: 300px;
            overflow-y: auto;
        }
        .layer-item {
            padding: 0.45rem 0.6rem;
            background: #1e293b;
            border-radius: 6px;
            cursor: grab;
            font-size: 0.8rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 0.4rem;
            transition: background 0.2s, box-shadow 0.15s, opacity 0.15s, transform 0.15s;
            border: 1px solid transparent;
            touch-action: none;
        }
        .layer-item .layer-main {
            display: flex;
            align-items: center;
            gap: 0.4rem;
            min-width: 0;
            overflow: hidden;
        }
        .layer-item .layer-name {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .layer-item {
            padding: 0.45rem 0.6rem;
            background: #1e293b;
            border-radius: 6px;
            cursor: grab;
            font-size: 0.8rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 0.4rem;
            transition: background 0.2s, box-shadow 0.15s, opacity 0.15s, transform 0.15s;
            border: 1px solid transparent;
            touch-action: none;
            overflow: visible;
        }
        .layer-item .layer-actions {
            display: flex;
            align-items: center;
            gap: 0.3rem;
            flex-shrink: 0;
            position: relative;
            overflow: visible;
        }
        .layer-opacity-toggle {
            border: 1px solid transparent;
            background: transparent;
            color: #94a3b8;
            border-radius: 4px;
            width: 22px;
            height: 22px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            padding: 0;
        }
        .layer-opacity-toggle:hover {
            background: transparent;
            color: #94a3b8;
        }
        .layer-opacity-toggle .material-symbols-outlined {
            font-size: 16px;
            line-height: 1;
        }
        .layer-visibility-toggle {
            border: 1px solid transparent;
            background: transparent;
            color: #94a3b8;
            border-radius: 4px;
            width: 22px;
            height: 22px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            padding: 0;
        }
        .layer-visibility-toggle:hover {
            background: transparent;
            color: #f1f5f9;
        }
        .layer-visibility-toggle .material-symbols-outlined {
            font-size: 16px;
            line-height: 1;
        }
        .layer-opacity-popover {
            position: absolute;
            right: calc(100% + 8px);
            top: 50%;
            transform: translateY(-50%);
            display: none;
            align-items: center;
            gap: 0.3rem;
            background: #111827;
            border: 1px solid #334155;
            border-radius: 8px;
            padding: 0.25rem 0.4rem;
            box-shadow: 0 8px 16px rgba(15, 23, 42, 0.4);
            min-width: 118px;
            max-width: 180px;
            z-index: 50;
        }
        .layer-eye-panel {
            position: fixed;
            display: none;
            flex-direction: column;
            background: #111827;
            border: 1px solid #334155;
            border-radius: 8px;
            padding: 0.4rem 0.55rem;
            box-shadow: 0 8px 16px rgba(15, 23, 42, 0.4);
            min-width: 160px;
            z-index: 100;
        }
        .layer-opacity-popover.active,
        .layer-eye-panel.active {
            display: flex;
        }
        .layer-opacity-popover button {
            width: 100%;
            border: none;
            background: transparent;
            color: #e2e8f0;
            padding: 0.5rem 0.85rem;
            font-size: 0.82rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.5rem;
            text-align: left;
        }
        .layer-eye-panel button {
            border: none;
            background: transparent;
            color: #e2e8f0;
            padding: 0.35rem 0.2rem;
            font-size: 0.82rem;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.25rem;
        }
        .layer-eye-panel .include-in-row {
            width: 100%;
            display: inline-flex;
            align-items: center;
            justify-content: space-between;
            text-align: left;
            padding: 0.35rem 0.85rem;
            gap: 0.6rem;
        }
        .layer-panel-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.35rem 0.85rem;
            color: #e2e8f0;
            font-size: 0.82rem;
        }
        .layer-panel-row.disabled {
            opacity: 0.45;
            pointer-events: none;
        }
        .layer-panel-toggle {
            border: none;
            background: transparent;
            color: #94a3b8;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0;
            min-width: 38px;
        }
        .layer-panel-toggle.active {
            color: #f5f5f5;
        }
        .layer-eye-panel button:hover,
        .layer-opacity-popover button:hover {
            background: transparent;
        }
        .layer-eye-panel .context-divider {
            margin: 4px 0;
            height: 1px;
            background: #334155;
        }
        .layer-opacity-popover input[type="range"] {
            -webkit-appearance: none;
            appearance: none;
            accent-color: #a3a3a3;
            width: 90px;
            height: 20px;
            margin: 0;
            border: none;
            box-shadow: none;
            outline: none;
            background: transparent;
            cursor: pointer;
        }
        .layer-opacity-popover input[type="range"]::-webkit-slider-runnable-track {
            height: 4px;
            border-radius: 999px;
            background: rgba(163, 163, 163, 0.42);
        }
        .layer-opacity-popover input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: #737373;
            border: 2px solid #f8fafc;
            margin-top: -4px;
            box-shadow: none;
        }
        .layer-opacity-popover input[type="range"]::-moz-range-track {
            height: 4px;
            border-radius: 999px;
            background: rgba(163, 163, 163, 0.42);
        }
        .layer-opacity-popover input[type="range"]::-moz-range-thumb {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: #737373;
            border: 2px solid #f8fafc;
            box-shadow: none;
        }
        .layer-opacity-popover input[type="range"]:hover,
        .layer-opacity-popover input[type="range"]:focus,
        .layer-opacity-popover input[type="range"]:active {
            border: none;
            box-shadow: none;
            outline: none;
            background: transparent;
            accent-color: #a3a3a3;
        }
        .layer-opacity-value {
            min-width: 36px;
            font-size: 0.7rem;
            color: #e2e8f0;
            text-align: right;
        }
        .layer-name-input {
            flex: 1;
            min-width: 0;
            background: #0f172a;
            color: #f1f5f9;
            border: 1px solid #a3a3a3;
            border-radius: 4px;
            padding: 1px 5px;
            font-size: inherit;
            font-family: inherit;
            outline: none;
        }
        .layer-item .drag-handle {
            color: #475569;
            font-size: 16px;
            cursor: grab;
            flex-shrink: 0;
            display: flex;
        }
        .layer-item:hover {
            background: #2d3a4f;
        }
        .layer-item:has(.layer-opacity-popover.active) {
            background: #1e293b;
        }
        .layer-item:has(.layer-opacity-popover.active):hover {
            background: #1e293b;
        }
        .layer-item:hover .drag-handle {
            color: #94a3b8;
        }
        .layer-item.active {
            background: #737373;
            color: white;
        }
        .layer-item.active .drag-handle {
            color: rgba(255, 255, 255, 0.7);
        }
        .layer-item.dimmed {
            opacity: 0.5;
            font-style: italic;
        }
        .layer-item.dragging {
            opacity: 0.4;
            transform: scale(0.98);
        }
        .layer-item.drag-preview {
            box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.5), 0 0 0 2px #a3a3a3;
            transform: scale(1.03);
            opacity: 0.55;
        }
        .layer-list {
            position: relative;
        }
        .layer-list .drop-indicator {
            position: absolute;
            left: 0;
            right: 0;
            height: 2px;
            background: #dbeafe;
            box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.7);
            pointer-events: none;
            z-index: 10;
        }
        .layer-item.drop-before {
            border-top: none;
            border-radius: 0;
        }
        .layer-item.drop-after {
            border-bottom: none;
            border-radius: 0;
        }
        .layer-list.drop-target-empty {
            border: 2px dashed #a3a3a3;
            border-radius: 6px;
            background: rgba(163, 163, 163, 0.06);
        }
        .layer-item .layer-type {
            font-size: 0.6rem;
            text-transform: uppercase;
            color: #94a3b8;
        }
        .layer-item.active .layer-type {
            color: rgba(255, 255, 255, 0.7);
        }
        .layer-item .indent {
            margin-right: 4px;
            color: #f59e0b;
        }
        .layer-item .layer-icon {
            font-size: 16px;
            flex-shrink: 0;
            color: #94a3b8;
        }
        .group-toggle,
        .layer-item .drag-handle {
            cursor: pointer;
            flex-shrink: 0;
            color: #94a3b8;
        }
        .group-toggle:hover,
        .layer-item .drag-handle:hover {
            color: #f8fafc;
        }
        .layer-item.active .layer-icon {
            color: rgba(255, 255, 255, 0.95);
        }
        .layer-item.active .layer-opacity-toggle {
            color: rgba(255, 255, 255, 0.95);
        }
        .layer-item.active .layer-opacity-toggle:hover {
            color: rgba(255, 255, 255, 0.95);
            background: transparent;
        }
        .layer-item.active .layer-opacity-toggle .material-symbols-outlined {
            color: rgba(255, 255, 255, 0.95);
        }
        .layer-item .hidden-badge {
            font-size: 10px;
            color: #ef4444;
            display: flex;
            align-items: center;
            gap: 2px;
            flex-shrink: 0;
        }
        .layer-item .hidden-badge .material-symbols-outlined {
            font-size: 13px;
        }
        .context-menu {
            display: none;
            position: fixed;
            background: #1e293b;
            border: 1px solid #334155;
            border-radius: 6px;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
            padding: 4px 0;
            z-index: 2000;
            min-width: 160px;
            flex-direction: column;
        }
        .context-menu.active {
            display: flex;
        }
        .context-item {
            padding: 8px 16px;
            font-size: 0.85rem;
            cursor: pointer;
            color: #e2e8f0;
            transition: background 0.1s;
            display: flex;
            align-items: center;
            gap: 0.6rem;
        }
        .context-item .material-symbols-outlined {
            font-size: 17px;
            color: #94a3b8;
        }
        .context-item:hover {
            background: #334155;
        }
        .context-item.disabled {
            color: #64748b;
            cursor: default;
        }
        .context-item.disabled .material-symbols-outlined {
            color: #475569;
        }
        .context-item.disabled:hover {
            background: transparent;
        }
        .context-divider {
            height: 1px;
            background: #334155;
            margin: 4px 0;
        }
        .flex-panel {
            display: none;
            flex-direction: column;
            position: fixed;
            background: #1e293b;
            border: 1px solid #334155;
            border-radius: 8px;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
            padding: 10px;
            z-index: 101;
            width: 320px;
            gap: 8px;
        }
        .flex-panel.active {
            display: flex;
        }
        .group-features-panel {
            display: none;
            flex-direction: column;
            position: fixed;
            background: rgba(15, 23, 42, 0.72);
            border: 1px solid rgba(148, 163, 184, 0.26);
            border-radius: 14px;
            box-shadow: 0 18px 38px -24px rgba(15, 23, 42, 0.9), 0 0 0 1px rgba(148, 163, 184, 0.08);
            backdrop-filter: blur(14px) saturate(160%);
            -webkit-backdrop-filter: blur(14px) saturate(160%);
            padding: 8px 8px 10px;
            z-index: 101;
            width: 265px;
            gap: 6px;
        }
        #prototypePanel {
            width: 265px;
            gap: 6px;
            padding: 8px 8px 10px;
        }
        #prototypePanel .group-panel-section {
            gap: 6px;
            padding: 6px 0;
        }
        #prototypePanel .group-btn-row button {
            padding: 5px 6px;
            min-height: 30px;
        }
        #prototypePanel .prop-group {
            margin-bottom: 0.35rem;
        }
        .group-features-panel.active {
            display: flex;
        }
        #groupFeaturesPanel {
            width: 292px;
            gap: 8px;
            padding: 10px 10px 12px;
            background: rgba(22, 22, 22, 0.72);
            border: 1px solid rgba(255, 255, 255, 0.16);
            border-radius: 12px;
            box-shadow: 0 22px 55px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
            backdrop-filter: blur(20px) saturate(125%);
            -webkit-backdrop-filter: blur(20px) saturate(125%);
        }
        #groupFeaturesPanel .group-panel-title {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            color: #f2f2f2;
            font-size: 0.78rem;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }
        #groupFeaturesPanel .group-panel-title .material-symbols-outlined {
            font-size: 16px;
            color: #bdbdbd;
        }
        #groupFeaturesPanel .group-panel-section {
            gap: 8px;
            padding: 9px 0;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }
        #groupFeaturesPanel .group-panel-section > label,
        #groupFeaturesPanel .group-panel-row label,
        #groupFeaturesPanel .link-input label {
            color: #bdbdbd;
            font-size: 0.7rem;
            letter-spacing: 0.03em;
        }
        #groupFeaturesPanel .group-btn-row {
            gap: 5px;
        }
        #groupFeaturesPanel .group-btn-row button {
            min-height: 29px;
            padding: 5px 7px;
            border: 1px solid rgba(255, 255, 255, 0.14);
            border-radius: 6px;
            background: rgba(255, 255, 255, 0.045);
            color: #cfcfcf;
            font-size: 0.7rem;
            transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
        }
        #groupFeaturesPanel .group-btn-row button:hover {
            background: rgba(255, 255, 255, 0.1);
            border-color: rgba(255, 255, 255, 0.28);
            color: #ffffff;
        }
        #groupFeaturesPanel .group-btn-row button.active {
            background: rgba(255, 255, 255, 0.16);
            border-color: rgba(255, 255, 255, 0.42);
            color: #ffffff;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
        }
        #groupFeaturesPanel .group-panel-row input,
        #groupFeaturesPanel .group-panel-row select,
        #groupFeaturesPanel .link-inputs input,
        #groupFeaturesPanel .link-inputs select {
            min-height: 29px;
            border: 1px solid rgba(255, 255, 255, 0.14);
            border-radius: 6px;
            background: rgba(0, 0, 0, 0.2);
            color: #eeeeee;
            padding: 5px 7px;
            font-size: 0.74rem;
        }
        #groupFeaturesPanel input[type="color"] {
            min-width: 34px;
            padding: 2px;
            cursor: pointer;
        }
        #groupFeaturesPanel .group-panel-row input:focus,
        #groupFeaturesPanel .group-panel-row select:focus,
        #groupFeaturesPanel .link-inputs input:focus,
        #groupFeaturesPanel .link-inputs select:focus {
            outline: none;
            border-color: rgba(255, 255, 255, 0.42);
            box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.07);
        }
        #groupFeaturesPanel .context-divider {
            width: 100%;
            margin: 1px 0 2px;
            border-top-color: rgba(255, 255, 255, 0.1);
        }
        #groupFeaturesPanel .flex-panel-done {
            width: 100%;
            min-height: 32px;
            border: 1px solid rgba(255, 255, 255, 0.22);
            border-radius: 6px;
            background: rgba(255, 255, 255, 0.1);
            color: #f5f5f5;
            font-size: 0.72rem;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.14s ease, border-color 0.14s ease;
        }
        #groupFeaturesPanel .flex-panel-done:hover {
            background: rgba(255, 255, 255, 0.17);
            border-color: rgba(255, 255, 255, 0.4);
        }
        #groupFeaturesPanel .panel-close-btn:hover {
            background: rgba(255, 255, 255, 0.12);
            border-color: rgba(255, 255, 255, 0.35);
            color: #ffffff;
        }
        .group-panel-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            margin-bottom: 2px;
        }
        .group-panel-title {
            font-size: 0.9rem;
            font-weight: 700;
            letter-spacing: 0.01em;
            color: #f8fafc;
        }
        .panel-close-btn {
            width: 28px;
            height: 28px;
            border: 1px solid rgba(148, 163, 184, 0.2);
            border-radius: 8px;
            background: rgba(15, 23, 42, 0.38);
            color: #cbd5e1;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, transform 0.12s ease;
        }
        .panel-close-btn:hover {
            background: rgba(249, 115, 22, 0.16);
            border-color: rgba(251, 191, 36, 0.9);
            color: #f8fafc;
            transform: translateY(-1px);
        }
        .panel-close-btn .material-symbols-outlined {
            font-size: 17px;
            line-height: 1;
        }
        .group-panel-section {
            display: flex;
            flex-direction: column;
            gap: 6px;
            padding: 6px 0;
            border-bottom: 1px solid #334155;
        }
        .group-panel-section:last-child {
            border-bottom: none;
        }
        .group-panel-section label {
            font-size: 0.75rem;
            color: #cbd5e1;
            display: block;
        }
        .group-btn-row {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 6px;
        }
        .group-btn-row button {
            padding: 5px 6px;
            min-height: 30px;
            font-size: 0.75rem;
            border: 1px solid rgba(148, 163, 184, 0.28);
            background: rgba(15, 23, 42, 0.38);
            color: #e2e8f0;
            border-radius: 8px;
            cursor: pointer;
        }
        .group-btn-row button.active {
            background: #f59e0b;
            border-color: #f59e0b;
            color: #111827;
            font-weight: 700;
        }
        .group-panel-row {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            align-items: center;
        }
        .group-panel-row label {
            flex: 1;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .group-panel-row input[type="number"],
        .group-panel-row input[type="color"],
        .link-inputs input[type="text"],
        .link-inputs select,
        .group-panel-section select,
        .group-panel-row input[type="text"] {
            width: 100%;
            border: 1px solid rgba(148, 163, 184, 0.22);
            border-radius: 8px;
            background: rgba(15, 23, 42, 0.38);
            color: #f8fafc;
            padding: 6px 8px;
            font-size: 0.85rem;
        }
        .link-inputs {
            display: block;
            gap: 8px;
        }
        .link-input {
            display: none;
        }
        .link-input.active {
            display: block;
        }
        .link-input label {
            font-size: 0.75rem;
            color: #cbd5e1;
            display: block;
        }
        .flex-panel-title {
            font-size: 0.8rem;
            font-weight: 600;
            color: #f1f5f9;
            margin-bottom: 2px;
        }
        .flex-panel-section label {
            display: block;
            font-size: 0.65rem;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: #94a3b8;
            margin-bottom: 4px;
        }
        .flex-btn-row {
            display: flex;
            flex-wrap: wrap;
            gap: 4px;
        }
        .flex-btn-row button {
            flex: 1 1 auto;
            padding: 5px 8px;
            font-size: 0.72rem;
            background: #0f172a;
            color: #cbd5e1;
            border: 1px solid #334155;
            border-radius: 4px;
            cursor: pointer;
            transition: 0.1s, border-color 0.1s;
        }
        .flex-btn-row button:hover {
            border-color: #f59e0b;
        }
        .flex-btn-row button.active {
            background: #f59e0b;
            border-color: #f59e0b;
            color: #1e293b;
            font-weight: 600;
        }
        .flex-panel-unbind {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.4rem;
            padding: 6px 8px;
            font-size: 0.75rem;
            background: transparent;
            color: #f87171;
            border: 1px solid #7f1d1d;
            border-radius: 4px;
            cursor: pointer;
        }
        .flex-panel-unbind:hover {
            background: rgba(248, 113, 113, 0.1);
        }
        .flex-panel-unbind .material-symbols-outlined {
            font-size: 15px;
        }
        .flex-panel-done {
            padding: 6px 8px;
            font-size: 0.75rem;
            background: #f59e0b;
            color: #111827;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-weight: 700;
        }
        .flex-panel-done:hover {
            background: #fbbf24;
        }
        .shape-layer.group-container.flex-bound {
            border-style: solid;
        }
        .group-proto-icon {
            position: absolute;
            top: 8px;
            left: 8px;
            width: 26px;
            height: 26px;
            border-radius: 50%;
            background: rgba(15, 23, 42, 0.75);
            color: #f8fafc;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            z-index: 30;
            pointer-events: auto;
        }
        .group-proto-icon.proto-trigger {
            cursor: pointer;
        }
        .prop-group {
            margin-bottom: 0.35rem;
        }
        .prop-group label {
            display: block;
            font-size: 0.7rem;
            color: #94a3b8;
            margin-bottom: 1px;
        }
        .prop-group input,
        .prop-group textarea,
        .prop-group select {
            width: 100%;
            padding: 0.3rem 0.5rem;
            background: #1e293b;
            border: 1px solid #334155;
            border-radius: 4px;
            color: #f1f5f9;
            font-size: 0.8rem;
            font-family: inherit;
            outline: none;
        }
        .prop-group input:focus {
            border-color: #a3a3a3;
        }
        .prop-group input[type="color"] {
            height: 36px;
            padding: 2px;
            cursor: pointer;
        }
        .font-picker-row {
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(72px, 0.8fr);
            gap: 8px;
            align-items: center;
        }
        .font-picker-row select {
            min-width: 0;
        }
        .font-picker-preview {
            min-width: 0;
            overflow: hidden;
            color: #f1f5f9;
            font-size: 1rem;
            line-height: 1.2;
            white-space: nowrap;
            text-overflow: ellipsis;
            text-align: right;
        }
        .prop-color-control {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .prop-color-control input[type="color"] {
            flex: 1;
        }
        .prop-transparent-option {
            display: inline-flex !important;
            align-items: center;
            gap: 0.25rem;
            flex-shrink: 0;
            white-space: nowrap;
        }
        .prop-transparent-option input[type="checkbox"] {
            width: auto;
            margin: 0;
        }
        .prop-group .row {
            display: flex;
            gap: 0.5rem;
        }
        .prop-group .row input {
            flex: 1;
        }
        .prop-input-with-prefix {
            position: relative;
            flex: 1;
            --prefix-slot: 22px;
        }
        .prop-input-prefix {
            position: absolute;
            left: 8px;
            top: 0;
            bottom: 0;
            color: #94a3b8;
            font-size: 0.7rem;
            font-weight: 700;
            letter-spacing: 0.02em;
            pointer-events: none;
            text-transform: uppercase;
            width: var(--prefix-slot);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
        }
        .prop-input-with-prefix input {
            padding-left: calc(8px + var(--prefix-slot) + 6px);
        }
        .prop-input-prefix.size-prefix {
            transform: translateY(-1px);
        }
        .prop-group input[type="number"] {
            -moz-appearance: textfield;
            appearance: textfield;
        }
        .prop-group input[type="range"] {
            -webkit-appearance: none;
            appearance: none;
            width: 100%;
            height: 24px;
            margin: 0;
            padding: 0;
            border: 0;
            outline: 0;
            background: transparent;
            accent-color: #a3a3a3;
            cursor: pointer;
        }
        .prop-group input[type="range"]::-webkit-slider-runnable-track {
            height: 4px;
            border-radius: 999px;
            background: #525252;
            transition: background 0.15s ease;
        }
        .prop-group input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 14px;
            height: 14px;
            margin-top: -5px;
            border: 2px solid #d4d4d4;
            border-radius: 50%;
            background: #737373;
            box-shadow: 0 0 0 1px #262626;
            transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
        }
        .prop-group input[type="range"]::-moz-range-track {
            height: 4px;
            border-radius: 999px;
            background: #525252;
            transition: background 0.15s ease;
        }
        .prop-group input[type="range"]::-moz-range-thumb {
            width: 14px;
            height: 14px;
            border: 2px solid #d4d4d4;
            border-radius: 50%;
            background: #737373;
            box-shadow: 0 0 0 1px #262626;
            transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
        }
        .prop-group input[type="range"]:hover::-webkit-slider-runnable-track,
        .prop-group input[type="range"]:focus::-webkit-slider-runnable-track,
        .prop-group input[type="range"]:active::-webkit-slider-runnable-track,
        .prop-group input[type="range"]:hover::-moz-range-track,
        .prop-group input[type="range"]:focus::-moz-range-track,
        .prop-group input[type="range"]:active::-moz-range-track {
            background: #737373;
        }
        .prop-group input[type="range"]:hover::-webkit-slider-thumb,
        .prop-group input[type="range"]:focus::-webkit-slider-thumb,
        .prop-group input[type="range"]:active::-webkit-slider-thumb,
        .prop-group input[type="range"]:hover::-moz-range-thumb,
        .prop-group input[type="range"]:focus::-moz-range-thumb,
        .prop-group input[type="range"]:active::-moz-range-thumb {
            background: #a3a3a3;
            border-color: #f5f5f5;
            box-shadow: 0 0 0 1px #404040;
        }
        .prop-group input[type="number"]::-webkit-outer-spin-button,
        .prop-group input[type="number"]::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }
        .prop-section {
            margin-bottom: 0.9rem;
            padding-bottom: 0.75rem;
            border-bottom: 1px solid #1e293b;
        }
        .prop-section-title {
            font-size: 0.68rem;
            font-weight: 600;
            letter-spacing: 0.04em;
            text-transform: uppercase;
            color: #64748b;
            margin-bottom: 0.6rem;
        }
        .items-settings-grid {
            display: grid;
            grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
            gap: 0.55rem;
            padding: 0.7rem 0 0.25rem;
        }
        .items-detail-row {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            gap: 0.65rem;
            margin-top: 0.45rem;
            padding: 0.7rem;
            border: 1px solid rgba(148, 163, 184, 0.15);
            border-radius: 6px;
            background: rgba(15, 23, 42, 0.46);
        }
        .items-detail-row strong {
            grid-column: 1 / -1;
            color: #cbd5e1;
            font-size: 0.68rem;
            font-weight: 600;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }
        .items-detail-row input[type="text"],
        .items-detail-row input[type="url"] {
            min-width: 0;
        }
        .items-divider-toggle {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.25rem;
            min-width: 92px;
            min-height: 32px;
            padding: 0.25rem 0.45rem;
            border: 1px solid rgba(212, 212, 216, 0.22);
            border-radius: 6px;
            background: rgba(255, 255, 255, 0.06);
            color: #a1a1aa;
            cursor: pointer;
            font: inherit;
            font-size: 0.68rem;
            white-space: nowrap;
        }
        .items-divider-toggle:hover,
        .items-divider-toggle.active {
            border-color: rgba(212, 212, 216, 0.42);
            background: rgba(212, 212, 216, 0.16);
            color: #fafafa;
        }
        .items-divider-toggle .material-symbols-outlined {
            font-size: 20px;
        }
        .items-anchor-toggle {
            display: flex !important;
            align-items: center;
            gap: 0.55rem;
            margin: 0.65rem 0 0.2rem;
            padding: 0.55rem 0.6rem;
            border: 1px solid rgba(251, 191, 36, 0.22);
            border-radius: 6px;
            background: rgba(251, 191, 36, 0.06);
        }
        .items-anchor-toggle input[type="checkbox"] {
            width: auto;
            accent-color: #fbbf24;
        }
        .items-anchor-toggle span {
            display: flex;
            flex-direction: column;
            gap: 0.12rem;
        }
        .items-anchor-toggle strong {
            color: #e2e8f0;
            font-size: 0.75rem;
        }
        .items-anchor-toggle small {
            color: #94a3b8;
            font-size: 0.65rem;
        }
        .lock-toggle-btn {
            flex: 0 0 auto;
            width: 32px;
            height: 32px;
            padding: 0;
            background: #1e293b;
            border: 1px solid #334155;
            border-radius: 4px;
            color: #94a3b8;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.15s, color 0.15s, border-color 0.15s;
        }
        .lock-toggle-btn .material-symbols-outlined {
            font-size: 16px;
        }
        .lock-toggle-btn:hover {
            border-color: #a3a3a3;
            color: #f5f5f5;
        }
        .lock-toggle-btn.active {
            background: #737373;
            border-color: #a3a3a3;
            color: #ffffff;
        }
        .no-selection {
            color: #64748b;
            font-size: 0.8rem;
            text-align: center;
            padding: 1rem 0;
        }
        .panel-btn {
            width: 100%;
            background: #1e293b;
            color: #94a3b8;
            border: 1px solid #334155;
            padding: 0.45rem 0.7rem;
            border-radius: 6px;
            font-size: 0.78rem;
            font-weight: 500;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: flex-start;
            text-align: left;
            gap: 0.4rem;
            transition: all 0.15s;
            font-family: inherit;
        }
        .panel-btn .material-symbols-outlined {
            font-size: 16px;
        }
        .panel-btn:hover {
            background: #ef4444;
            color: white;
            border-color: #ef4444;
        }
        .status-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.3rem 1rem;
            background: #0f172a;
            border-top: 1px solid #334155;
            font-size: 0.7rem;
            color: #64748b;
            flex-shrink: 0;
            height: 30px;
        }
        .modal-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(2, 6, 23, 0.72);
            backdrop-filter: blur(4px);
            z-index: 1000;
            align-items: center;
            justify-content: center;
        }
        .modal-overlay.active {
            display: flex;
        }
        .modal {
            background: #191919;
            border-radius: 12px;
            padding: 1.5rem 1.35rem 1rem;
            max-width: 700px;
            width: 90%;
            max-height: 80vh;
            overflow: auto;
            border: 1px solid #2a2a2a;
            box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.03);
        }
        .modal h2 {
            color: #f1f5f9;
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 1.1rem;
        }
        .modal h2 .material-symbols-outlined {
            font-size: 22px;
            color: #a3a3a3;
        }
        .rename-modal {
            max-width: 380px;
            width: min(90vw, 380px);
            padding: 1.1rem 1rem 0.85rem;
            border-radius: 10px;
        }
        .rename-modal h2 {
            margin: 0 0 0.9rem;
            padding-bottom: 0.4rem;
            border-bottom: 1px solid rgba(148, 163, 184, 0.15);
            font-size: 0.95rem;
            letter-spacing: 0.01em;
        }
        .items-setup-modal {
            max-width: 380px;
        }
        .items-setup-modal .prop-group {
            margin-bottom: 0.85rem;
        }
        .items-setup-modal select,
        .items-setup-modal input[type="number"] {
            width: 100%;
            box-sizing: border-box;
        }
        .rename-dialog-label {
            display: block;
            color: #d4d4d8;
            font-size: 0.74rem;
            margin-bottom: 0.45rem;
            text-transform: uppercase;
            letter-spacing: 0.08em;
        }
        .rename-dialog-input {
            width: 100%;
            box-sizing: border-box;
            padding: 0.72rem 0.8rem;
            border-radius: 8px;
            border: 1px solid #3f3f46;
            background: rgba(24, 24, 27, 0.9);
            color: #f4f4f5;
            font-size: 0.92rem;
            outline: none;
            transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
        }
        .rename-dialog-input:focus {
            border-color: #a1a1aa;
            box-shadow: 0 0 0 2px rgba(161, 161, 170, 0.18);
            background: rgba(28, 28, 31, 0.96);
        }
        .modal-actions {
            display: flex;
            justify-content: flex-end;
            gap: 0.5rem;
            margin-top: 0.9rem;
        }
        .modal-actions button {
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            padding: 0.55rem 0.9rem;
            border-radius: 7px;
            font-size: 0.78rem;
            font-weight: 600;
            line-height: 1;
        }
        .modal-actions .btn-close {
            background: #27272a;
            color: #d4d4d8;
            border: 1px solid #3f3f46;
        }
        .modal-actions .btn-close:hover {
            background: #3f3f46;
            color: #f4f4f5;
        }
        .modal-actions .btn-copy {
            background: #f4f4f5;
            color: #111827;
            border: 1px solid #f4f4f5;
        }
        .modal-actions .btn-copy:hover {
            background: #e5e7eb;
            color: #111827;
        }
        .modal pre {
            background: #0f172a;
            padding: 1rem;
            border-radius: 8px;
            overflow: auto;
            max-height: 400px;
            font-size: 0.7rem;
            color: #94a3b8;
            white-space: pre-wrap;
            word-wrap: break-word;
            border: 1px solid #334155;
        }
        .modal-actions {
            display: flex;
            gap: 0.75rem;
            margin-top: 1rem;
            justify-content: flex-end;
        }
        .modal-actions button {
            padding: 0.5rem 1.5rem;
            border: none;
            border-radius: 4px;
            font-weight: 700;
            cursor: pointer;
        }
        .modal-actions .btn-close {
            background: #334155;
            color: #94a3b8;
        }
        .modal-actions .btn-close:hover {
            background: #475569;
        }
        .modal-actions .btn-copy {
            background: #737373;
            color: white;
        }
        .modal-actions .btn-copy:hover {
            background: #7C3AED;
        }
        .sketch-preview {
            position: absolute;
            pointer-events: none;
            z-index: 600;
            opacity: 0.55;
            box-sizing: border-box;
        }
        .sketch-preview.rect-preview {
            background: #737373;
            border-radius: 4px;
        }
        .sketch-preview.circle-preview {
            background: #737373;
            border-radius: 50%;
        }
        .sketch-preview.text-preview {
            border: 2px dashed #a3a3a3;
            background: rgba(163, 163, 163, 0.12);
        }
        .sketch-preview.image-preview {
            border: 2px solid #94a3b8;
            background: #cbd5e1;
        }
        :root {
            --theme-bg: #0d0d0d;
            --theme-surface: #262626;
            --theme-muted: #595959;
            --theme-text: #f2f2f2;
            --theme-subtle: #b8b8b8;
            --theme-border: rgba(89, 89, 89, 0.52);
            --theme-panel: rgba(38, 38, 38, 0.82);
            --theme-glow: rgba(255, 255, 255, 0.04);
        }
        body {
            background: var(--theme-bg);
            color: var(--theme-text);
            position: relative;
            isolation: isolate;
        }
        body::before {
            content: '';
            position: fixed;
            inset: 0;
            pointer-events: none;
            z-index: 0;
            background:
                radial-gradient(1200px 680px at 12% 8%, rgba(255, 255, 255, 0.07), transparent 60%),
                radial-gradient(900px 560px at 88% 12%, rgba(255, 255, 255, 0.045), transparent 62%),
                linear-gradient(160deg, #171717 0%, #101010 42%, #0d0d0d 100%);
        }
        body::after {
            content: '';
            position: fixed;
            inset: 0;
            pointer-events: none;
            z-index: 0;
            opacity: 0.16;
            mix-blend-mode: soft-light;
            background-image:
                repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 3px),
                repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 4px);
        }
        body>* {
            position: relative;
            z-index: 1;
        }
        .app-loader {
            position: fixed;
            inset: 0;
            z-index: 10000;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #111;
            color: #f2f2f2;
            transition: opacity 260ms ease, visibility 260ms ease;
        }
        .app-loader {
            background: radial-gradient(60% 50% at 50% 42%, rgba(13, 153, 255, 0.10), transparent 70%), #0d0d0d;
        }
        .splash { display: flex; flex-direction: column; align-items: center; gap: 10px; transition: transform 260ms ease; }
        .splash-logo { display: flex; align-items: flex-end; gap: 5px; margin-bottom: 8px; }
        .splash-mark { overflow: visible; }
        .splash-mark > * { transform-box: fill-box; transform-origin: center; opacity: 0; animation: splash-land 680ms cubic-bezier(.2, .9, .3, 1.15) forwards; }
        .splash-mark .is-left { --from: translate(-90px, -60px) rotate(-70deg) scale(0.4); animation-delay: 150ms; }
        .splash-mark .is-dip { --from: translate(10px, 110px) rotate(180deg) scale(0.4); animation-delay: 280ms; }
        .splash-mark .is-right { --from: translate(100px, -70px) rotate(70deg) scale(0.4); animation-delay: 410ms; }
        .splash-name { font: 800 88px/0.72 Inter, -apple-system, Arial, sans-serif; letter-spacing: -0.055em; color: #f5f5f5; opacity: 0; clip-path: inset(-20% 100% -30% 0); animation: splash-wipe 520ms 760ms cubic-bezier(.3, .8, .3, 1) forwards; }
        .splash-tagline { font: 500 0.82rem/1.3 Inter, -apple-system, Arial, sans-serif; color: #8a8a8a; opacity: 0; animation: splash-rise 420ms 640ms ease-out forwards; }
        .splash-progress { position: relative; width: 140px; height: 2px; margin-top: 18px; border-radius: 2px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
        .splash-progress span { position: absolute; inset: 0 auto 0 0; width: 40%; border-radius: 2px; background: #0d99ff; animation: splash-slide 1.1s ease-in-out infinite; }
        .splash-status { min-height: 1em; font: 500 0.7rem/1 Inter, -apple-system, Arial, sans-serif; letter-spacing: 0.04em; color: #595959; }
        body.app-ready .splash { transform: scale(1.04); }
        @keyframes splash-wipe { from { opacity: 1; clip-path: inset(-20% 100% -30% 0); } to { opacity: 1; clip-path: inset(-20% -5% -30% 0); } }
        @keyframes splash-land { from { opacity: 0; transform: var(--from); } to { opacity: 1; transform: var(--to, none); } }
        @keyframes splash-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
        @keyframes splash-slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
        @media (prefers-reduced-motion: reduce) {
            .splash-mark > *, .splash-name, .splash-tagline { animation: none; opacity: 1; transform: none; clip-path: none; }
            .splash-progress span { animation: none; width: 100%; opacity: 0.4; }
            body.app-ready .splash { transform: none; }
        }
        .app-loader ~ * {
            visibility: hidden;
        }
        html.auth-required:not(.auth-signed-in) body > *:not(.auth-gate):not(.app-loader) { visibility: hidden !important; }
        .file-menu-account { display: none; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--theme-border); }
        html.auth-signed-in .file-menu-account { display: block; }
        .file-menu-account > span { display: block; padding: 4px 12px 2px; font-size: 0.72rem; color: var(--theme-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
        .auth-gate { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; padding: 24px; background: radial-gradient(60% 50% at 50% 40%, rgba(13, 153, 255, 0.08), transparent 70%), #0d0d0d; overflow-y: auto; }
        .auth-gate[hidden] { display: none; }
        .auth-card { width: min(100%, 380px); display: flex; flex-direction: column; gap: 12px; padding: 32px 28px; border: 1px solid var(--theme-border); border-radius: 18px; background: #161616; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); color: #f2f2f2; font-family: Inter, -apple-system, Arial, sans-serif; }
        .auth-logo { display: flex; align-items: flex-end; gap: 2px; margin-bottom: 6px; font: 800 44px/0.72 Inter, Arial, sans-serif; letter-spacing: -0.055em; }
        .auth-logo svg { display: block; }
        .auth-card h1 { margin: 6px 0 0; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
        .auth-pitch { margin: -6px 0 6px; font-size: 0.85rem; color: #8a8a8a; }
        .auth-google { display: flex; align-items: center; justify-content: center; gap: 10px; height: 44px; border: 1px solid #333; border-radius: 10px; background: #f2f2f2; color: #111; font: 600 0.9rem Inter, Arial, sans-serif; cursor: pointer; }
        .auth-google:hover { background: #ffffff; }
        .auth-or { display: flex; align-items: center; gap: 10px; color: #6b6b6b; font-size: 0.75rem; }
        .auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: #2a2a2a; }
        .auth-row { display: flex; flex-direction: column; gap: 6px; font-size: 0.78rem; color: #b8b8b8; }
        .auth-row[hidden], .auth-or[hidden], .auth-google[hidden], .auth-google-button[hidden], .auth-link[hidden] { display: none; }
        .auth-google-button { display: flex; justify-content: center; min-height: 44px; color: #8a8a8a; font-size: 0.8rem; }
        .auth-row input { height: 42px; padding: 0 12px; border: 1px solid #2f2f2f; border-radius: 10px; background: #0f0f0f; color: #f2f2f2; font: 0.9rem Inter, Arial, sans-serif; }
        .auth-row input:focus { outline: 2px solid #0d99ff; outline-offset: 0; border-color: transparent; }
        .auth-link, .auth-switch button { align-self: flex-start; padding: 0; border: 0; background: none; color: #6fb8ff; font: 500 0.8rem Inter, Arial, sans-serif; cursor: pointer; }
        .auth-submit { height: 44px; border: 0; border-radius: 10px; background: #0d99ff; color: #fff; font: 700 0.92rem Inter, Arial, sans-serif; cursor: pointer; }
        .auth-submit:hover { background: #2aa5ff; }
        .auth-card button:disabled, .auth-card input:disabled { opacity: 0.6; cursor: default; }
        .auth-card button:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }
        .auth-message { min-height: 1.2em; margin: 0; font-size: 0.8rem; color: #b8b8b8; }
        .auth-message[data-kind="error"] { color: #ff8a7a; }
        .auth-message[data-kind="ok"] { color: #8fe0bf; }
        .auth-switch { margin: 0; font-size: 0.8rem; color: #8a8a8a; }
        .auth-legal { margin: 4px 0 0; font-size: 0.72rem; line-height: 1.4; color: #6b6b6b; }
        .auth-legal a { color: #9a9a9a; }
        body:not(.icons-ready) .material-symbols-outlined {
            display: inline-block;
            width: 1em;
            overflow: hidden;
            color: transparent !important;
            white-space: nowrap;
        }
        body.app-ready .app-loader {
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
        }
        body.app-ready .app-loader ~ * {
            visibility: visible;
        }
        @keyframes app-loader-spin {
            to { transform: rotate(360deg); }
        }
        .toolbar,
        .top-tabs,
        .workspace-bar,
        .sidebar,
        .status-bar,
        .context-menu,
        .experiment-panel,
        .layer-eye-panel,
        .layer-opacity-popover,
        .flex-panel,
        .group-features-panel,
        .modal,
        .modal pre,
        .panel,
        .canvas-wrapper {
            background: var(--theme-panel);
            border-color: var(--theme-border);
            color: var(--theme-text);
            box-shadow: inset 0 1px 0 var(--theme-glow);
        }
        .toolbar,
        .top-tabs,
        .workspace-bar,
        .status-bar,
        .sidebar-tabs,
        .tab-item,
        .sidebar-tab,
        .context-divider,
        .experiment-divider,
        .layer-eye-panel .context-divider,
        .modal pre,
        .toolbar-divider {
            border-color: var(--theme-border);
            background-color: transparent;
        }
        .tool-btn,
        .tab-item,
        .sidebar-tab,
        .workspace-status,
        .context-item,
        .layer-item,
        .layer-panel-row,
        .experiment-label,
        .experiment-height-unit,
        .status-bar,
        #statusInfo,
        #layerCount {
            color: var(--theme-subtle);
        }
        .tool-btn:hover,
        .tab-item:hover,
        .sidebar-tab:hover,
        .context-item:hover,
        .layer-item:hover,
        .experiment-breakpoint-chip:hover,
        .experiment-breakpoint-add-btn:hover,
        .experiment-height-btn:hover,
        .modal-actions .btn-close:hover {
            background: var(--theme-surface);
            color: var(--theme-text);
        }
        .context-item.disabled,
        .context-item.disabled .material-symbols-outlined {
            color: #737373;
        }
        .context-item.disabled:hover,
        .context-item.disabled:active {
            background: transparent;
            color: #737373;
            cursor: default;
        }
        .tool-btn.active,
        .overflow-toggle.active,
        .sidebar-tab.active,
        .tab-item.active,
        .layer-item.active,
        .experiment-breakpoint-chip.active,
        .layer-panel-toggle.active,
        .layer-opacity-popover button.active,
        .context-item.active {
            background: rgba(89, 89, 89, 0.28);
            color: var(--theme-text);
            border-color: var(--theme-border);
        }
        .layer-item {
            background: rgba(38, 38, 38, 0.72);
            border-color: transparent;
            color: var(--theme-subtle);
        }
        .layer-item:hover,
        .layer-item:has(.layer-opacity-popover.active),
        .layer-item:has(.layer-opacity-popover.active):hover {
            background: rgba(50, 50, 50, 0.9);
            color: var(--theme-text);
        }
        .layer-item.active {
            background: rgba(89, 89, 89, 0.34);
            color: var(--theme-text);
            border-color: var(--theme-border);
        }
        .layer-item .indent,
        .layer-item .layer-type,
        .layer-item .layer-icon,
        .group-toggle,
        .layer-item .drag-handle {
            color: var(--theme-subtle);
        }
        .layer-item.active .layer-type,
        .layer-item.active .layer-icon,
        .layer-item.active .drag-handle,
        .layer-item.active .layer-opacity-toggle,
        .layer-item.active .layer-opacity-toggle .material-symbols-outlined {
            color: var(--theme-text);
        }
        .layer-item.drop-before {
            border-top: 2px solid var(--theme-muted);
            border-radius: 0;
        }
        .layer-item.drop-after {
            border-bottom: 2px solid var(--theme-muted);
            border-radius: 0;
        }
        .layer-list.drop-target-empty {
            border: 2px dashed var(--theme-muted);
            border-radius: 6px;
            background: rgba(89, 89, 89, 0.12);
        }
        .layer-item.drag-preview {
            box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(89, 89, 89, 0.8);
        }
        .tool-btn.active .material-symbols-outlined,
        .app-title .material-symbols-outlined,
        .layer-panel-toggle.active .material-symbols-outlined,
        .overflow-toggle.active .material-symbols-outlined {
            color: var(--theme-text);
        }
        .experiment-height-btn,
        .experiment-height-input,
        .experiment-breakpoint-input,
        .experiment-breakpoint-add-btn,
        .modal-actions .btn-close,
        .modal-actions .btn-copy,
        .layer-name-input,
        .group-panel-row input,
        .group-panel-row select,
        .link-input input,
        .link-input select,
        .panel-btn {
            background: rgba(38, 38, 38, 0.9);
            color: var(--theme-text);
            border-color: var(--theme-border);
        }
        .prop-group label,
        .prop-section-title,
        .prop-input-prefix,
        .no-selection {
            color: var(--theme-subtle);
        }
        .prop-section {
            border-bottom-color: var(--theme-border);
        }
        .prop-group input,
        .prop-group textarea,
        .prop-group select {
            background: rgba(38, 38, 38, 0.9);
            color: var(--theme-text);
            border-color: var(--theme-border);
        }
        .prop-group input:focus,
        .prop-group textarea:focus,
        .prop-group select:focus {
            border-color: var(--theme-muted);
            outline: 1px solid rgba(89, 89, 89, 0.45);
        }
        .lock-toggle-btn {
            background: rgba(38, 38, 38, 0.9);
            border-color: var(--theme-border);
            color: var(--theme-subtle);
        }
        .lock-toggle-btn:hover,
        .lock-toggle-btn.active {
            background: rgba(53, 53, 53, 0.92);
            border-color: var(--theme-muted);
            color: var(--theme-text);
        }
        .experiment-panel-title,
        .experiment-panel-title .material-symbols-outlined,
        .experiment-label,
        .experiment-height-unit {
            color: var(--theme-subtle);
        }
        .experiment-divider {
            background: var(--theme-border);
        }
        .experiment-breakpoint-chip {
            background: rgba(38, 38, 38, 0.84);
            border-color: var(--theme-border);
            color: var(--theme-text);
        }
        .experiment-breakpoint-chip:hover {
            background: rgba(53, 53, 53, 0.9);
            border-color: var(--theme-muted);
            color: var(--theme-text);
        }
        .experiment-breakpoint-chip.active {
            background: rgba(89, 89, 89, 0.3);
            border-color: var(--theme-muted);
            color: var(--theme-text);
        }
        .experiment-breakpoint-remove {
            color: var(--theme-subtle);
        }
        .experiment-breakpoint-remove:hover {
            color: var(--theme-text);
            background: rgba(89, 89, 89, 0.2);
        }
        .experiment-height-input:focus,
        .experiment-breakpoint-input:focus,
        .layer-name-input:focus,
        .group-panel-row input:focus,
        .group-panel-row select:focus,
        .link-input input:focus,
        .link-input select:focus {
            outline-color: var(--theme-muted);
            border-color: var(--theme-muted);
        }
        .shape-layer:hover,
        .shape-layer.selected,
        .shape-layer.text-layer:hover,
        .shape-layer.dragging,
        .shape-layer.resizing,
        .shape-layer.group-container,
        .shape-layer.group-container.selected {
            border-color: var(--theme-muted);
            outline-color: rgba(89, 89, 89, 0.38);
            box-shadow: 0 8px 18px -10px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(89, 89, 89, 0.72);
        }
        .shape-layer.has-shadow { box-shadow: var(--layer-shadow); }
        .shape-layer.has-shadow:hover,
        .shape-layer.has-shadow.selected,
        .shape-layer.has-shadow.dragging,
        .shape-layer.has-shadow.resizing {
            box-shadow: 0 0 0 1px rgba(89, 89, 89, 0.72), var(--layer-shadow);
        }
        .resize-handle,
        .shape-layer.group-container .resize-handle,
        .sketch-preview.rect-preview,
        .sketch-preview.circle-preview {
            background: var(--theme-muted);
            border-color: #e8e8e8;
        }
        .sketch-preview.text-preview {
            border-color: var(--theme-muted);
            background: rgba(89, 89, 89, 0.18);
        }
        .canvas.resizing-canvas .canvas-resize-tip,
        .canvas-screen-handle,
        .canvas-resize-tip {
            background: rgba(38, 38, 38, 0.82);
            border-color: var(--theme-border);
            color: var(--theme-text);
        }
        .canvas-resize-tip::before {
            background: var(--theme-muted);
        }
        .modal-actions .btn-copy {
            background: var(--theme-surface);
            color: var(--theme-text);
        }
        .modal-actions .btn-copy:hover {
            background: #323232;
        }
        .canvas {
            box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
        }
        .context-menu,
        .experiment-panel,
        .layer-eye-panel,
        .layer-opacity-popover,
        .flex-panel,
        .group-features-panel,
        .modal {
            backdrop-filter: blur(10px);
            border-color: var(--theme-border);
        }
        .flex-panel-title,
        .flex-panel-section label {
            color: var(--theme-subtle);
        }
        .flex-btn-row button {
            background: rgba(38, 38, 38, 0.9);
            color: var(--theme-text);
            border-color: var(--theme-border);
        }
        .flex-btn-row button:hover {
            background: rgba(53, 53, 53, 0.9);
            border-color: var(--theme-muted);
            color: var(--theme-text);
        }
        .flex-btn-row button.active {
            background: rgba(89, 89, 89, 0.32);
            border-color: var(--theme-muted);
            color: var(--theme-text);
            font-weight: 600;
        }
        .flex-panel-unbind,
        .flex-panel-done {
            background: rgba(38, 38, 38, 0.9);
            color: var(--theme-text);
            border: 1px solid var(--theme-border);
        }
        .flex-panel-unbind:hover,
        .flex-panel-done:hover {
            background: rgba(53, 53, 53, 0.92);
            border-color: var(--theme-muted);
            color: var(--theme-text);
        }
        ::-webkit-scrollbar {
            width: 4px;
            height: 4px;
        }
        ::-webkit-scrollbar-track {
            background: #151515;
        }
        ::-webkit-scrollbar-thumb {
            background: #4e4e4e;
            border-radius: 2px;
        }
        .export-mode {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            margin-bottom: 0.75rem;
            font-size: 0.8rem;
            color: var(--theme-subtle, #b8b8b8);
        }
        .export-mode select {
            flex: 1;
            padding: 0.45rem 0.6rem;
            border-radius: 6px;
            border: 1px solid var(--theme-border, #334155);
            background: var(--theme-surface, #262626);
            color: var(--theme-text, #f2f2f2);
            font: inherit;
        }
        .smart-guides,
        .structure-overlay {
            position: absolute;
            inset: 0;
            pointer-events: none;
            overflow: visible;
            z-index: 9000;
        }
        .smart-guides { z-index: 9001; }
        .sg-line { position: absolute; background: #ff2d87; }
        .sg-dist { position: absolute; background: #f24822; }
        .sg-hover {
            position: absolute;
            box-sizing: border-box;
            outline: 1px solid #f24822;
            outline-offset: -1px;
        }
        .sg-label,
        .sg-size {
            position: absolute;
            padding: 3px 5px;
            border-radius: 3px;
            color: #fff;
            background: #f24822;
            font: 600 11px/1 Arial, Helvetica, sans-serif;
            white-space: nowrap;
        }
        .sg-size { background: #0d99ff; }
        .so-box {
            position: absolute;
            box-sizing: border-box;
            border: calc(1px * var(--inv, 1)) dashed rgba(13, 153, 255, 0.9);
            background: rgba(13, 153, 255, 0.04);
        }
        .so-column {
            border-color: rgba(151, 71, 255, 0.9);
            background: rgba(151, 71, 255, 0.04);
        }
        .so-abs {
            border-color: rgba(245, 158, 11, 0.95);
            background: rgba(245, 158, 11, 0.07);
        }
        .so-chip {
            position: absolute;
            left: 0;
            bottom: 100%;
            transform: scale(var(--inv, 1));
            transform-origin: 0 100%;
            padding: 2px 5px;
            border-radius: 3px 3px 0 0;
            color: #fff;
            background: #0d99ff;
            font: 600 10px/1.2 Arial, Helvetica, sans-serif;
            white-space: nowrap;
        }
        .so-chip.inside {
            top: 0;
            bottom: auto;
            transform-origin: 0 0;
            border-radius: 0 0 3px 0;
        }
        .so-column > .so-chip { background: #9747ff; }
        .so-abs > .so-chip { background: #d97706; }
        .sg-equal { position: absolute; background: #ff2d87; }
        .sg-label-equal { background: #ff2d87; }
        .marquee {
            position: absolute;
            box-sizing: border-box;
            border: 1px solid #0d99ff;
            background: rgba(13, 153, 255, 0.08);
        }
        .shape-layer.marquee-hit,
        .shape-layer:hover:not(.selected):not(.hidden) {
            outline: 1.5px solid #0d99ff;
            outline-offset: 0;
        }
        .align-bar {
            position: fixed;
            top: 0;
            left: 0;
            z-index: 50;
            display: flex;
            align-items: center;
            gap: 2px;
            padding: 4px;
            border: 1px solid var(--theme-border, rgba(89, 89, 89, 0.52));
            border-radius: 10px;
            background: var(--theme-surface, #262626);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
            opacity: 0;
            pointer-events: none;
            transform: translate(-50%, -6px);
            transition: opacity 0.12s ease, transform 0.12s ease;
        }
        .align-bar.visible {
            opacity: 1;
            pointer-events: auto;
            transform: translate(-50%, 0);
        }
        .align-bar button {
            display: grid;
            place-items: center;
            width: 30px;
            height: 30px;
            padding: 0;
            border: 0;
            border-radius: 6px;
            color: var(--theme-text, #f2f2f2);
            background: transparent;
            cursor: pointer;
        }
        .align-bar button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); }
        .align-bar button:disabled { opacity: 0.35; cursor: default; }
        .align-bar button .material-symbols-outlined { font-size: 19px; }
        .align-bar-sep {
            width: 1px;
            height: 18px;
            margin: 0 4px;
            background: var(--theme-border, rgba(89, 89, 89, 0.52));
        }
        .prop-input-with-prefix .prop-input-prefix {
            pointer-events: auto;
            cursor: ew-resize;
            user-select: none;
        }
        body.is-scrubbing,
        body.is-scrubbing * {
            cursor: ew-resize !important;
            user-select: none !important;
        }
        .page-summary {
            display: flex;
            flex-direction: column;
            gap: 6px;
            padding: 4px 2px;
        }
        .page-summary .prop-section-title { margin-top: 10px; }
        .page-summary .prop-section-title:first-child { margin-top: 0; }
        .page-summary-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            font-size: 0.75rem;
            color: var(--theme-subtle, #b8b8b8);
        }
        .page-summary-row strong {
            color: var(--theme-text, #f2f2f2);
            font-weight: 600;
        }
        .page-summary-row kbd {
            flex-shrink: 0;
            padding: 2px 6px;
            border: 1px solid var(--theme-border, rgba(89, 89, 89, 0.52));
            border-radius: 4px;
            color: var(--theme-text, #f2f2f2);
            background: rgba(255, 255, 255, 0.04);
            font: 600 0.68rem/1.4 Inter, Arial, sans-serif;
            white-space: nowrap;
        }
        .layer-role-badge {
            flex-shrink: 0;
            margin-left: 6px;
            padding: 1px 6px;
            border-radius: 999px;
            color: #0d99ff;
            background: rgba(13, 153, 255, 0.12);
            font-size: 0.62rem;
            font-weight: 600;
            letter-spacing: 0.02em;
            white-space: nowrap;
        }
        .prop-role select { width: 100%; }
        .prop-hint {
            margin: 0 0 4px;
            color: var(--theme-subtle, #b8b8b8);
            font-size: 0.72rem;
            line-height: 1.45;
        }
        .page-summary .panel-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            width: 100%;
        }
        .context-item kbd {
            margin-left: auto;
            padding-left: 16px;
            color: var(--theme-subtle, #8a8a8a);
            font: 500 0.68rem/1 Inter, Arial, sans-serif;
        }
        .screen-switcher-wrap {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 3px;
            border: 1px solid var(--theme-border, rgba(89, 89, 89, 0.52));
            border-radius: 10px;
            background: rgba(255, 255, 255, 0.03);
        }
        .screen-switcher {
            display: flex;
            align-items: center;
            gap: 2px;
        }
        .screen-btn {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            height: 30px;
            padding: 0 10px;
            border: 0;
            border-radius: 7px;
            color: var(--theme-subtle, #b8b8b8);
            background: transparent;
            font: 600 0.72rem/1 Inter, Arial, sans-serif;
            white-space: nowrap; 
            flex-shrink: 0;
            cursor: pointer;
            transition: background 0.12s ease, color 0.12s ease;
        }
        .screen-btn .material-symbols-outlined { font-size: 18px; }
        .screen-btn:hover { color: var(--theme-text, #f2f2f2); background: rgba(255, 255, 255, 0.06); }
        .screen-btn.active {
            color: #fff;
            background: #0d99ff;
        }
        .screen-btn-width { font-variant-numeric: tabular-nums; }
        .screen-reflow { color: #c4b5fd; }
        .so-grid {
            border-color: rgba(20, 184, 166, 0.9);
            background: rgba(20, 184, 166, 0.05);
        }
        .so-grid > .so-chip { background: #0d9488; }
        .canvas-empty {
            position: absolute;
            inset: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 24px;
            color: #64748b;
            text-align: center;
            font: 400 14px/1.5 Inter, Arial, sans-serif;
            pointer-events: none;
        }
        .canvas-empty strong {
            color: #0f172a;
            font-size: 18px;
            font-weight: 600;
        }
        .canvas-empty span { max-width: 380px; }
        .top-tabs[hidden] { display: none; }
        .layer-custom-dot {
            flex-shrink: 0;
            width: 6px;
            height: 6px;
            margin-left: 6px;
            border-radius: 50%;
            background: #a78bfa;
        }
        .screen-status {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-bottom: 10px;
            padding: 7px 9px;
            border-radius: 8px;
            color: var(--theme-subtle, #b8b8b8);
            background: rgba(255, 255, 255, 0.04);
            font-size: 0.72rem;
        }
        .screen-status .material-symbols-outlined { font-size: 16px; }
        .screen-status span:nth-child(2) { flex: 1; }
        .screen-status.custom {
            color: #ddd6fe;
            background: rgba(167, 139, 250, 0.12);
        }
        .screen-status button {
            padding: 3px 8px;
            border: 1px solid rgba(167, 139, 250, 0.5);
            border-radius: 6px;
            color: #ddd6fe;
            background: transparent;
            font: 600 0.68rem/1.2 Inter, Arial, sans-serif;
            cursor: pointer;
        }
        .screen-status button:hover { background: rgba(167, 139, 250, 0.18); }
        .segmented {
            display: flex;
            padding: 2px;
            border: 1px solid var(--theme-border, rgba(89, 89, 89, 0.52));
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.03);
        }
        .segmented button {
            flex: 1;
            padding: 6px 4px;
            border: 0;
            border-radius: 6px;
            color: var(--theme-subtle, #b8b8b8);
            background: transparent;
            font: 600 0.7rem/1 Inter, Arial, sans-serif;
            cursor: pointer;
        }
        .segmented button.active { color: #fff; background: #0d99ff; }
        .segmented button:not(.active):hover { color: var(--theme-text, #f2f2f2); }
        .screens-panel { width: 280px; padding: 12px; }
        .screens-panel-title { margin-bottom: 8px; font: 700 0.8rem/1 Inter, Arial, sans-serif; color: var(--theme-text, #f2f2f2); }
        .screens-panel-label { margin: 12px 0 6px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--theme-subtle, #8a8a8a); }
        .screens-list { display: flex; flex-direction: column; gap: 2px; }
        .screens-row { display: flex; align-items: center; gap: 4px; border-radius: 7px; }
        .screens-row.active { background: rgba(13, 153, 255, 0.14); }
        .screens-row-main {
            flex: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
            padding: 7px 8px; border: 0; border-radius: 7px; background: transparent; cursor: pointer;
            color: var(--theme-text, #f2f2f2); font: 500 0.75rem/1.2 Inter, Arial, sans-serif; text-align: left;
        }
        .screens-row-main span { color: var(--theme-subtle, #8a8a8a); font-size: 0.7rem; }
        .screens-row-main:hover { background: rgba(255, 255, 255, 0.05); }
        .screens-row-remove, .screens-row-lock {
            display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 6px;
            background: transparent; color: var(--theme-subtle, #8a8a8a); cursor: pointer;
        }
        .screens-row-lock { cursor: default; font-size: 15px; }
        .screens-row-remove .material-symbols-outlined { font-size: 16px; }
        .screens-row-remove:hover { color: #fca5a5; background: rgba(239, 68, 68, 0.12); }
        .screens-presets { display: flex; flex-wrap: wrap; gap: 4px; }
        .screens-presets button {
            display: inline-flex; gap: 5px; padding: 5px 8px; border: 1px solid var(--theme-border, rgba(89, 89, 89, 0.52));
            border-radius: 999px; background: transparent; color: var(--theme-text, #f2f2f2);
            font: 500 0.7rem/1.2 Inter, Arial, sans-serif; cursor: pointer;
        }
        .screens-presets button span { color: var(--theme-subtle, #8a8a8a); }
        .screens-presets button:hover { border-color: #0d99ff; }
        .screens-custom { display: flex; gap: 6px; margin-top: 8px; }
        .screens-custom input {
            flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--theme-border, rgba(89, 89, 89, 0.52));
            border-radius: 7px; background: rgba(255, 255, 255, 0.03); color: var(--theme-text, #f2f2f2); font: inherit;
        }
        .screens-custom button {
            padding: 6px 12px; border: 0; border-radius: 7px; background: #0d99ff; color: #fff;
            font: 600 0.72rem/1 Inter, Arial, sans-serif; cursor: pointer;
        }
        .screens-hint { margin: 10px 0 0; font-size: 0.68rem; line-height: 1.45; color: var(--theme-subtle, #8a8a8a); }
        .zoom-level { min-width: 48px; justify-content: center; font-variant-numeric: tabular-nums; font-size: 0.72rem; }
        .proto-overlay {
            position: absolute;
            inset: 0;
            overflow: visible;
            pointer-events: none;
            z-index: 9002;
        }
        .proto-wire {
            fill: none;
            stroke: #0d99ff;
            stroke-width: calc(2px * var(--inv, 1));
            opacity: 0.5;
        }
        .proto-wire.selected { opacity: 1; }
        .proto-wire.dragging { stroke-dasharray: calc(6px * var(--inv, 1)) calc(4px * var(--inv, 1)); }
        .proto-label {
            fill: #0d99ff;
            font: 600 calc(11px * var(--inv, 1)) Inter, Arial, sans-serif;
            text-anchor: middle;
            paint-order: stroke;
            stroke: #ffffff;
            stroke-width: calc(3px * var(--inv, 1));
        }
        .proto-handle {
            position: absolute;
            z-index: 9003;
            display: grid;
            place-items: center;
            width: 22px;
            height: 22px;
            padding: 0;
            border: 2px solid #ffffff;
            border-radius: 50%;
            color: #ffffff;
            background: #0d99ff;
            box-shadow: 0 2px 6px rgba(13, 153, 255, 0.45);
            cursor: crosshair;
            pointer-events: auto;
        }
        .proto-handle .material-symbols-outlined { font-size: 16px; }
        .proto-handle:hover { background: #0b85e0; }
        .shape-layer.proto-drop-target {
            outline: 2px solid #0d99ff !important;
            outline-offset: 2px;
        }
        .shape-layer.starts-hidden {
            opacity: 0.45 !important;
            outline: 1px dashed #0d99ff;
            outline-offset: 2px;
        }
        body.prototype-mode #prototypeToggle {
            color: #fff;
            background: #0d99ff;
        }
        .prop-check {
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 2px 0 8px;
            font-size: 0.75rem;
            color: var(--theme-text, #f2f2f2);
            cursor: pointer;
        }
        .state-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
        .state-chip {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 5px 10px;
            border: 1px solid var(--theme-border, rgba(89, 89, 89, 0.52));
            border-radius: 999px;
            color: var(--theme-text, #f2f2f2);
            background: transparent;
            font: 600 0.72rem/1.1 Inter, Arial, sans-serif;
            cursor: pointer;
        }
        .state-chip:hover { border-color: #a78bfa; }
        .state-chip.active { color: #fff; background: #8b5cf6; border-color: #8b5cf6; }
        .state-chip.add { padding: 3px 6px; color: var(--theme-subtle, #b8b8b8); }
        .state-chip.add .material-symbols-outlined { font-size: 16px; }
        .state-chip-tag {
            padding: 1px 5px;
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.18);
            font-size: 0.6rem;
            font-weight: 600;
        }
        .state-options { margin-top: 4px; }
        .state-actions { display: flex; gap: 6px; }
        .state-actions button {
            flex: 1;
            padding: 6px 8px;
            border: 1px solid var(--theme-border, rgba(89, 89, 89, 0.52));
            border-radius: 7px;
            color: var(--theme-text, #f2f2f2);
            background: transparent;
            font: 600 0.7rem/1 Inter, Arial, sans-serif;
            cursor: pointer;
        }
        .state-actions button.primary { color: #fff; background: #8b5cf6; border-color: #8b5cf6; }
        .shape-layer.state-editing {
            outline: 2px solid #8b5cf6 !important;
            outline-offset: 3px;
        }
        .state-banner {
            position: fixed;
            z-index: 60;
            display: none;
            align-items: center;
            gap: 10px;
            padding: 8px 8px 8px 14px;
            border-radius: 12px;
            color: #fff;
            background: #7c3aed;
            box-shadow: 0 10px 30px rgba(76, 29, 149, 0.45);
            font: 500 0.78rem/1.3 Inter, Arial, sans-serif;
            transform: translate(-50%, 0);
        }
        .state-banner.visible { display: flex; }
        .state-banner .material-symbols-outlined { font-size: 18px; }
        .state-banner button {
            padding: 6px 12px;
            border: 0;
            border-radius: 8px;
            color: #4c1d95;
            background: #fff;
            font: 700 0.72rem/1 Inter, Arial, sans-serif;
            cursor: pointer;
        }
        .export-mode[hidden],
        .btn-copy[hidden] { display: none !important; }
        .page-menu-wrapper { position: relative; }
        .page-menu-button { gap: 4px; }
        .page-menu-button #pageMenuLabel { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .page-menu {
            position: absolute;
            top: calc(100% + 6px);
            left: 0;
            z-index: 1200;
            width: 240px;
            padding: 6px;
            border: 1px solid var(--theme-border, rgba(89, 89, 89, 0.52));
            border-radius: 10px;
            background: var(--theme-surface, #262626);
            box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
        }
        .page-menu-row { display: flex; align-items: center; gap: 2px; border-radius: 7px; }
        .page-menu-row.active { background: rgba(13, 153, 255, 0.14); }
        .page-menu-main {
            flex: 1;
            display: flex;
            align-items: center;
            gap: 8px;
            min-width: 0;
            padding: 7px 8px;
            border: 0;
            border-radius: 7px;
            background: transparent;
            color: var(--theme-text, #f2f2f2);
            font: 500 0.78rem/1.2 Inter, Arial, sans-serif;
            text-align: left;
            cursor: pointer;
        }
        .page-menu-main .material-symbols-outlined { font-size: 17px; color: var(--theme-subtle, #8a8a8a); }
        .page-menu-main:hover { background: rgba(255, 255, 255, 0.05); }
        .page-menu-icon {
            display: grid;
            place-items: center;
            width: 26px;
            height: 26px;
            border: 0;
            border-radius: 6px;
            background: transparent;
            color: var(--theme-subtle, #8a8a8a);
            cursor: pointer;
        }
        .page-menu-icon .material-symbols-outlined { font-size: 16px; }
        .page-menu-icon:hover { color: var(--theme-text, #f2f2f2); background: rgba(255, 255, 255, 0.06); }
        .page-menu-add {
            display: flex;
            align-items: center;
            gap: 6px;
            width: 100%;
            margin-top: 4px;
            padding: 7px 8px;
            border: 1px dashed var(--theme-border, rgba(89, 89, 89, 0.52));
            border-radius: 7px;
            background: transparent;
            color: var(--theme-text, #f2f2f2);
            font: 600 0.75rem/1 Inter, Arial, sans-serif;
            cursor: pointer;
        }
        .page-menu-add:hover { border-color: #0d99ff; }
        .page-dock {
            position: fixed;
            z-index: 55;
            display: flex;
            flex-direction: column;
            gap: 6px;
            width: 168px;
            padding: 10px;
            border: 1px solid rgba(13, 153, 255, 0.4);
            border-radius: 12px;
            background: var(--theme-surface, #262626);
            box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
        }
        .page-dock-title {
            font: 700 0.66rem/1 Inter, Arial, sans-serif;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            color: #0d99ff;
        }
        .page-dock-card {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 12px 10px;
            border: 1px solid var(--theme-border, rgba(89, 89, 89, 0.52));
            border-radius: 9px;
            background: rgba(255, 255, 255, 0.03);
            color: var(--theme-text, #f2f2f2);
            font: 600 0.75rem/1.2 Inter, Arial, sans-serif;
        }
        .page-dock-card .material-symbols-outlined { font-size: 18px; color: #0d99ff; }
        .page-dock-card.proto-drop-target {
            border-color: #0d99ff;
            background: rgba(13, 153, 255, 0.16);
            outline: 2px solid #0d99ff;
        }
        .proto-chip {
            position: absolute;
            z-index: 9003;
            padding: 3px 8px;
            border-radius: 999px;
            color: #ffffff;
            background: #0d99ff;
            box-shadow: 0 2px 6px rgba(13, 153, 255, 0.35);
            font: 600 11px/1.2 Inter, Arial, sans-serif;
            white-space: nowrap;
            pointer-events: none;
        }
        .flow-board {
            position: fixed;
            z-index: 70;
            display: flex;
            flex-direction: column;
            background: #1b1b1b;
            background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
            background-size: 22px 22px;
        }
        .flow-bar, .flow-inspector {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            background: var(--theme-surface, #262626);
            color: var(--theme-text, #f2f2f2);
            font: 500 0.78rem/1.2 Inter, Arial, sans-serif;
        }
        .flow-bar { border-bottom: 1px solid var(--theme-border, rgba(89, 89, 89, 0.52)); }
        .flow-inspector { min-height: 46px; border-top: 1px solid var(--theme-border, rgba(89, 89, 89, 0.52)); flex-wrap: wrap; }
        .flow-bar-hint, .flow-muted { color: var(--theme-subtle, #8a8a8a); font-size: 0.72rem; }
        .flow-bar-spacer { flex: 1; }
        .flow-arrow { color: #0d99ff; font-weight: 600; }
        .flow-bar button, .flow-inspector button, .flow-inspector select {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 6px 10px;
            border: 1px solid var(--theme-border, rgba(89, 89, 89, 0.52));
            border-radius: 7px;
            background: transparent;
            color: var(--theme-text, #f2f2f2);
            font: 600 0.72rem/1 Inter, Arial, sans-serif;
            cursor: pointer;
        }
        .flow-bar button .material-symbols-outlined { font-size: 16px; }
        .flow-bar button.primary { color: #fff; background: #0d99ff; border-color: #0d99ff; }
        .flow-inspector label { display: inline-flex; align-items: center; gap: 6px; color: var(--theme-subtle, #b8b8b8); font-size: 0.72rem; }
        .flow-inspector select { background: var(--theme-surface, #262626); }
        .flow-scroll { position: relative; flex: 1; overflow: auto; }
        .flow-content { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
        .flow-sizer { pointer-events: none; }
        .flow-artboard {
            position: absolute;
            background: #ffffff;
            box-shadow: 0 6px 30px rgba(0, 0, 0, 0.45);
            outline: 2px solid transparent;
            transition: outline-color 0.12s ease;
        }
        .flow-artboard.drop { outline: 4px solid #0d99ff; }
        .flow-artboard.failed::after { content: 'Could not render this page'; position: absolute; inset: 0; display: grid; place-items: center; color: #b91c1c; }
        .flow-artboard iframe { display: block; border: 0; pointer-events: none; background: #ffffff; }
        .flow-artboard-label {
            position: absolute;
            bottom: 100%;
            left: 0;
            display: flex;
            align-items: center;
            gap: 8px;
            padding-bottom: 10px;
            color: #e5e5e5;
            font: 600 28px/1 Inter, Arial, sans-serif;
            white-space: nowrap;
            cursor: pointer;
        }
        .flow-artboard-label span:not(.material-symbols-outlined) { color: #8a8a8a; font-size: 20px; font-weight: 500; }
        .flow-artboard-label .material-symbols-outlined { color: #0d99ff; font-size: 30px; }
        .flow-wires { position: absolute; top: 0; left: 0; overflow: visible; pointer-events: none; z-index: 2; }
        .flow-wire { fill: none; stroke: #0d99ff; stroke-width: 3; opacity: 0.75; }
        .flow-wire.selected { opacity: 1; stroke-width: 4; }
        .flow-wire.dragging { stroke-dasharray: 10 7; }
        .flow-hits { position: absolute; inset: 0; z-index: 3; }
        .flow-hit { position: absolute; cursor: pointer; }
        .flow-hit:hover { outline: 2px solid rgba(13, 153, 255, 0.55); }
        .flow-hit.selected { outline: 3px solid #0d99ff; }
        .flow-handle {
            position: absolute;
            z-index: 4;
            display: grid;
            place-items: center;
            width: 26px;
            height: 26px;
            padding: 0;
            border: 2px solid #ffffff;
            border-radius: 50%;
            color: #ffffff;
            background: #0d99ff;
            box-shadow: 0 2px 8px rgba(13, 153, 255, 0.5);
            cursor: crosshair;
        }
        .flow-handle .material-symbols-outlined { font-size: 18px; }
        .flow-chip {
            position: absolute;
            z-index: 3;
            padding: 3px 9px;
            border-radius: 999px;
            color: #ffffff;
            background: #0d99ff;
            font: 600 11px/1.2 Inter, Arial, sans-serif;
            white-space: nowrap;
            pointer-events: none;
        }
        .tool-btn.icon-only { padding-left: 8px; padding-right: 8px; }
        .toolbar-left, .toolbar-right { min-width: 0; }
        @media (max-width: 1700px) {
            .toolbar .tool-btn:not(.export-btn):not(.page-menu-button):not(.zoom-btn):not(.icon-only) {
                font-size: 0;
                gap: 0;
                padding-left: 8px;
                padding-right: 8px;
            }
            .toolbar .tool-btn:not(.export-btn):not(.page-menu-button) .material-symbols-outlined { font-size: 20px; }
        }
        .screen-switcher-wrap { flex-shrink: 0; }
        @media (max-width: 1300px) {
            .toolbar { padding: 0 0.5rem; }
            .app-title, .toolbar-divider { display: none; }
            .zoom-controls .zoom-btn:not(.zoom-level) { display: none; }
            .page-menu-button #pageMenuLabel { max-width: 70px; }
            .screen-btn { padding: 0 7px; }
        }
        @media (max-width: 1100px) {
            .page-menu-button #pageMenuLabel { display: none; }
            .toolbar .export-btn { font-size: 0; gap: 0; padding-left: 9px; padding-right: 9px; }
            .toolbar .export-btn .material-symbols-outlined { font-size: 20px; }
        }
        .state-boards { position: absolute; z-index: 5; }
        .state-board {
            position: absolute;
            top: 0;
            cursor: pointer;
        }
        .state-board-frame {
            position: absolute;
            inset: 0;
            overflow: hidden;
            border-radius: 8px;
            background: #ffffff;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
            outline: 2px solid transparent;
            transition: outline-color 0.12s ease;
        }
        .state-board:hover .state-board-frame { outline-color: rgba(139, 92, 246, 0.7); }
        .state-board.proto-drop-target .state-board-frame { outline: 4px solid #0d99ff; }
        .state-board-label {
            position: absolute;
            bottom: calc(100% + 8px);
            left: 0;
            display: flex;
            align-items: center;
            gap: 6px;
            color: #e5e5e5;
            font: 600 0.82rem/1 Inter, Arial, sans-serif;
            white-space: nowrap;
        }
        .state-board-label .material-symbols-outlined { font-size: 17px; color: #a78bfa; }
        .state-board-label button {
            display: grid;
            place-items: center;
            width: 22px;
            height: 22px;
            padding: 0;
            border: 0;
            border-radius: 5px;
            color: #9ca3af;
            background: transparent;
            opacity: 0;
            cursor: pointer;
        }
        .state-board:hover .state-board-label button { opacity: 1; }
        .state-board-label button:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
        .state-board-label button .material-symbols-outlined { font-size: 15px; color: inherit; }
        .state-board-add {
            position: absolute;
            top: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 6px;
            width: 220px;
            padding: 16px;
            border: 2px dashed rgba(167, 139, 250, 0.55);
            border-radius: 12px;
            color: #ddd6fe;
            background: rgba(139, 92, 246, 0.06);
            font: 600 0.85rem/1.2 Inter, Arial, sans-serif;
            text-align: center;
            cursor: pointer;
        }
        .state-board-add small { color: #a1a1aa; font-weight: 500; font-size: 0.7rem; }
        .state-board-add .material-symbols-outlined { font-size: 28px; }
        .state-board-add:hover { border-color: #a78bfa; background: rgba(139, 92, 246, 0.12); }
        .canvas.page-state-editing { outline: 3px solid #8b5cf6; outline-offset: 4px; }
        .state-board-tiles {
            position: absolute;
            top: 0;
            display: flex;
            flex-direction: column;
            gap: 12px;
            width: 220px;
        }
        .state-board-tiles .state-board-add { position: static; width: 100%; height: auto; min-height: 130px; }
        .state-board-tiles .state-board-add.secondary { min-height: 90px; border-color: rgba(148, 163, 184, 0.4); color: #cbd5e1; background: transparent; }
        .overlay-board .state-board-frame { border-radius: 12px; box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55); }
        .overlay-board iframe { display: block; border: 0; transform-origin: 0 0; pointer-events: none; background: #ffffff; }
        .overlay-board:hover .state-board-frame { outline-color: rgba(13, 153, 255, 0.7); }
        .overlay-board .state-board-label .material-symbols-outlined:first-child { color: #38bdf8; }
        .state-board-kind {
            padding: 1px 6px;
            border-radius: 999px;
            color: #7dd3fc;
            background: rgba(56, 189, 248, 0.14);
            font-size: 0.62rem;
            font-weight: 600;
        }
        .overlay-banner { background: #0369a1; box-shadow: 0 10px 30px rgba(3, 105, 161, 0.45); }
        .overlay-banner button { color: #075985; }
        .page-menu-heading {
            margin: 10px 8px 4px;
            color: var(--theme-subtle, #8a8a8a);
            font: 700 0.64rem/1 Inter, Arial, sans-serif;
            letter-spacing: 0.06em;
            text-transform: uppercase;
        }
        .overlay-width {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 0 8px;
            color: #7dd3fc;
            font: 600 0.72rem/1 Inter, Arial, sans-serif;
        }
        .overlay-width .material-symbols-outlined { font-size: 18px; }
        .overlay-backdrop input[type="range"] { width: 72px; padding: 0; border: 0; background: none; }
        .overlay-backdrop output { min-width: 32px; color: #f2f2f2; font-variant-numeric: tabular-nums; }
        .overlay-width input {
            width: 64px;
            padding: 5px 6px;
            border: 1px solid rgba(56, 189, 248, 0.45);
            border-radius: 6px;
            background: rgba(255, 255, 255, 0.04);
            color: #f2f2f2;
            font: inherit;
            text-align: right;
        }
        .screen-btn[hidden] { display: none; }
        .overlay-ghost-backdrop {
            position: absolute;
            z-index: 9000;
            background: rgba(15, 23, 42, 0.32);
            pointer-events: none;
        }
        .overlay-ghost {
            position: absolute;
            z-index: 9001;
            outline: 2px dashed #38bdf8; 
            outline-offset: 2px;
            background: #ffffff;
            cursor: grab;
            overflow: visible;
        }
        .overlay-ghost.is-screen { cursor: move; }
        .overlay-ghost.dragging { cursor: grabbing; opacity: 0.85; }
        .overlay-ghost iframe {
            display: block;
            border: 0;
            pointer-events: none;
            background: #ffffff;
        }
        .overlay-ghost-tag {
            position: absolute;
            left: 0;
            bottom: 100%;
            margin-bottom: 6px;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 3px 8px;
            border-radius: 999px;
            background: #0284c7;
            color: #ffffff;
            font: 600 11px/1.2 Inter, Arial, sans-serif;
            white-space: nowrap;
            transform-origin: 0 100%;
            pointer-events: none;
        }
        .overlay-ghost-tag .material-symbols-outlined { font-size: 14px; }
        .overlay-ghost-tag small { font-weight: 500; opacity: 0.75; margin-left: 4px; }
        .overlay-ghost.is-screen .overlay-ghost-tag { bottom: auto; top: 6px; left: 6px; margin: 0; transform-origin: 0 0; }
        .seg-control { display: flex; gap: 4px; }
        .seg-control button {
            flex: 1;
            display: grid;
            place-items: center;
            padding: 4px 0;
            border: 1px solid #334155;
            border-radius: 4px;
            background: #1e293b;
            color: #94a3b8;
            cursor: pointer;
        }
        .seg-control button .material-symbols-outlined { font-size: 18px; }
        .seg-control button:hover { color: #f1f5f9; }
        .seg-control button.active { border-color: #38bdf8; color: #38bdf8; background: rgba(56, 189, 248, 0.1); }
        .prop-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
        .app-dialog-backdrop {
            position: fixed;
            inset: 0;
            z-index: 20000;
            display: grid;
            place-items: center;
            padding: 16px;
            background: rgba(0, 0, 0, 0.5);
            animation: app-dialog-fade 120ms ease-out;
        }
        .app-dialog {
            width: min(380px, 100%);
            padding: 18px;
            border: 1px solid #333333;
            border-radius: 12px;
            background: #1f1f1f;
            color: #f2f2f2;
            box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
            font-family: Inter, Arial, sans-serif;
            animation: app-dialog-pop 140ms cubic-bezier(.2, .7, .2, 1);
        }
        .app-dialog h2 { margin: 0 0 6px; font-size: 0.95rem; font-weight: 600; }
        .app-dialog p { margin: 0 0 14px; color: #a3a3a3; font-size: 0.8rem; line-height: 1.45; }
        .app-dialog input {
            width: 100%;
            margin: 6px 0 14px;
            padding: 8px 10px;
            border: 1px solid #3a3a3a;
            border-radius: 6px;
            background: #141414;
            color: #f2f2f2;
            font: inherit;
            font-size: 0.85rem;
            outline: none;
        }
        .app-dialog input:focus { border-color: #0d99ff; box-shadow: 0 0 0 3px rgba(13, 153, 255, 0.2); }
        .app-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
        .app-dialog-actions button {
            padding: 7px 14px;
            border: 1px solid #3a3a3a;
            border-radius: 6px;
            background: transparent;
            color: #e5e5e5;
            font: 600 0.78rem Inter, Arial, sans-serif;
            cursor: pointer;
        }
        .app-dialog-actions button:hover { background: rgba(255, 255, 255, 0.06); }
        .app-dialog-actions button.primary { border-color: #0d99ff; background: #0d99ff; color: #ffffff; }
        .app-dialog-actions button.primary:hover { background: #0b87e0; }
        .app-dialog-actions button.danger { border-color: #ef4444; background: #ef4444; color: #ffffff; }
        .app-dialog-actions button.danger:hover { background: #dc2626; }
        .app-dialog-actions button:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }
        @keyframes app-dialog-fade { from { opacity: 0; } }
        @keyframes app-dialog-pop { from { opacity: 0; transform: translateY(6px) scale(0.98); } }
        .overlay-height {
            display: inline-flex;
            align-items: center;
            gap: 2px;
            margin-left: 4px;
            padding-left: 10px;
            border-left: 1px solid rgba(255, 255, 255, 0.1);
            color: #7dd3fc;
            font: 600 0.72rem/1 Inter, Arial, sans-serif;
        }
        .overlay-height span { margin-right: 6px; }
        .overlay-height button {
            padding: 5px 8px;
            border: 1px solid transparent;
            border-radius: 6px;
            background: transparent;
            color: #a3a3a3;
            font: inherit;
            cursor: pointer;
        }
        .overlay-height button:hover { color: #f2f2f2; }
        .overlay-height button.active { border-color: rgba(56, 189, 248, 0.45); background: rgba(56, 189, 248, 0.12); color: #e0f2fe; }
        .export-note {
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 0 0 10px;
            padding: 8px 10px;
            border: 1px solid rgba(245, 158, 11, 0.4);
            border-radius: 8px;
            background: rgba(245, 158, 11, 0.08);
            color: #fcd34d;
            font-size: 0.78rem;
            line-height: 1.4;
        }
        .export-note[hidden] { display: none; }
        .export-note .material-symbols-outlined { font-size: 18px; }
        .export-note span:nth-child(2) { flex: 1; }
        .export-note button {
            flex-shrink: 0;
            padding: 5px 10px;
            border: 1px solid rgba(245, 158, 11, 0.5);
            border-radius: 6px;
            background: transparent;
            color: #fde68a;
            font: 600 0.75rem Inter, Arial, sans-serif;
            cursor: pointer;
        }
        .export-note button:hover { background: rgba(245, 158, 11, 0.15); }
        .canvas.overlay-canvas { margin-bottom: max(380px, 100vh); }
        .overlay-height button, .overlay-width { white-space: nowrap; }
        .state-banner-check {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 0 4px 0 10px;
            border-left: 1px solid rgba(255, 255, 255, 0.25);
            font-size: 0.75rem;
            white-space: nowrap;
            cursor: pointer;
        }
        .state-banner-check input { margin: 0; accent-color: #ffffff; }
        .overlay-ghost-tag .overlay-ghost-hide {
            display: grid;
            place-items: center;
            margin-left: 4px;
            padding: 1px;
            border: 0;
            border-radius: 4px;
            background: rgba(255, 255, 255, 0.15);
            color: #ffffff;
            cursor: pointer;
            pointer-events: auto;
        }
        .overlay-ghost-tag .overlay-ghost-hide:hover { background: rgba(255, 255, 255, 0.3); }
        .overlay-ghost-tag .overlay-ghost-hide .material-symbols-outlined { font-size: 13px; }
        .link-btn {
            padding: 0;
            border: 0;
            background: none;
            color: #38bdf8;
            font: inherit;
            text-decoration: underline;
            cursor: pointer;
        }
        .proto-guide {
            position: fixed;
            top: 64px;
            left: 50%;
            z-index: 15000;
            width: min(440px, calc(100vw - 32px));
            padding: 16px 18px 14px;
            border: 1px solid rgba(13, 153, 255, 0.45);
            border-radius: 12px;
            background: #1b1b1b;
            color: #e5e5e5;
            box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
            font: 0.8rem/1.5 Inter, Arial, sans-serif;
            transform: translateX(-50%);
            animation: app-dialog-pop 160ms cubic-bezier(.2, .7, .2, 1);
        }
        .proto-guide-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 0.9rem; }
        .proto-guide-head .material-symbols-outlined { color: #0d99ff; }
        .proto-guide ol { margin: 0 0 12px; padding-left: 20px; }
        .proto-guide li { margin-bottom: 6px; }
        .proto-guide ul { margin: 4px 0 0; padding-left: 16px; color: #a3a3a3; }
        .proto-guide ul li { margin-bottom: 2px; }
        .proto-guide em { color: #7dd3fc; font-style: normal; }
        .proto-guide-dot {
            display: inline-grid;
            place-items: center;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: #0d99ff;
            color: #ffffff;
            font-weight: 700;
            font-size: 11px;
            line-height: 1;
        }
        .proto-guide-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
        .proto-guide-actions span { color: #8a8a8a; font-size: 0.72rem; }
        .proto-guide-actions button {
            flex-shrink: 0;
            padding: 7px 16px;
            border: 0;
            border-radius: 6px;
            background: #0d99ff;
            color: #ffffff;
            font: 600 0.78rem Inter, Arial, sans-serif;
            cursor: pointer;
        }
        .tool-btn.proto-help { display: none; padding-left: 6px; padding-right: 6px; margin-left: -4px; }
        body.prototype-mode .tool-btn.proto-help { display: inline-flex; }
        .overlay-ghost .overlay-ghost-tag,
        .overlay-ghost.is-screen .overlay-ghost-tag {
            top: auto;
            bottom: 6px;
            left: 6px;
            margin: 0;
            transform-origin: 0 100%;
            overflow: hidden;
            box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
        }
        .overlay-ghost-name { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
        .overlay-ghost-tag small { flex-shrink: 1; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
        .overlay-ghost-tag .material-symbols-outlined, .overlay-ghost-tag .overlay-ghost-hide { flex-shrink: 0; }
        .radius-handle {
            position: absolute;
            z-index: 11;
            width: 10px;
            height: 10px;
            margin: -5px 0 0 -5px;
            border: 2px solid #0d99ff;
            border-radius: 50%;
            background: #ffffff;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
            cursor: crosshair;
            pointer-events: auto;
            touch-action: none;
        }
        .radius-handle:hover { transform: scale(1.25); }
        .radius-row { display: flex; gap: 6px; align-items: center; }
        .radius-row > input { flex: 1; }
        .radius-corners { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
        .radius-corners input { min-width: 0; }
        .radius-lock {
            display: grid;
            place-items: center;
            width: 30px;
            height: 30px;
            flex-shrink: 0;
            border: 1px solid #334155;
            border-radius: 4px;
            background: #1e293b;
            color: #94a3b8;
            cursor: pointer;
        }
        .radius-lock .material-symbols-outlined { font-size: 16px; }
        .radius-lock.active { border-color: #38bdf8; color: #38bdf8; }
        .radius-lock:hover { color: #f1f5f9; }
        #ctxRadiusLock[hidden] { display: none; }
        #ctxRadiusLock .ctx-radius-label { flex: 1; }
        #ctxRadiusLock .ctx-check { margin-left: auto; font-size: 16px; visibility: hidden; color: #38bdf8; }
        #ctxRadiusLock.checked .ctx-check { visibility: visible; }
        .overlay-ghost-resize {
            position: absolute;
            z-index: 2;
            touch-action: none;
        }
        .overlay-ghost-resize.is-e { top: 0; right: calc(-6px * var(--inv, 1)); width: calc(12px * var(--inv, 1)); height: 100%; cursor: ew-resize; }
        .overlay-ghost-resize.is-s { left: 0; bottom: calc(-6px * var(--inv, 1)); width: 100%; height: calc(12px * var(--inv, 1)); cursor: ns-resize; }
        .overlay-ghost-resize.is-se {
            right: calc(-7px * var(--inv, 1));
            bottom: calc(-7px * var(--inv, 1));
            width: calc(14px * var(--inv, 1));
            height: calc(14px * var(--inv, 1));
            border: calc(2px * var(--inv, 1)) solid #ffffff;
            border-radius: 50%;
            background: #0284c7;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
            cursor: nwse-resize;
        }
        .overlay-ghost-resize.is-e:hover, .overlay-ghost-resize.is-s:hover { background: rgba(56, 189, 248, 0.25); }
        .state-board-name.is-editable { cursor: text; border-radius: 4px; padding: 0 3px; margin: 0 -3px; }
        .state-board-name.is-editable:hover { background: rgba(255, 255, 255, 0.08); }
        .board-wires {
            position: absolute;
            top: 0;
            left: 0;
            z-index: 6;
            overflow: visible;
            pointer-events: none;
        }
        .board-wire {
            fill: none;
            stroke-width: 2;
            stroke-linecap: round;
            opacity: 0.8;
            pointer-events: visibleStroke;
            transition: stroke-width 0.12s, opacity 0.12s;
        }
        .board-wire.selected,
        .board-wire.hot { stroke-width: 3.5; opacity: 1; }
        .board-wire-chip {
            position: absolute;
            z-index: 7;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 3px 9px 3px 6px;
            border: 0;
            border-radius: 999px;
            background: var(--wire);
            color: #ffffff;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
            font: 600 11px/1.2 Inter, Arial, sans-serif;
            white-space: nowrap;
            transform: translate(-50%, -50%);
            cursor: pointer;
        }
        .board-wire-chip .material-symbols-outlined { font-size: 14px; }
        .board-wire-chip small { font-weight: 500; opacity: 0.8; }
        .board-wire-chip.selected { outline: 2px solid #ffffff; outline-offset: 1px; }
        .board-wire-chip:hover { filter: brightness(1.1); }
        .state-board.has-wire .state-board-label { box-shadow: inset 3px 0 0 var(--wire); padding-left: 8px; }
        .state-board.has-wire .state-board-frame { outline: 2px solid color-mix(in srgb, var(--wire) 55%, transparent); }
        .state-board.wire-hot .state-board-frame { outline: 3px solid var(--wire); }
        .prop-color-control input[type="color"] { flex: 0 0 36px; width: 36px; height: 30px; padding: 2px; }
        .prop-color-control input[type="color"].is-transparent {
            background-image: linear-gradient(45deg, #64748b 25%, transparent 25%, transparent 75%, #64748b 75%), linear-gradient(45deg, #64748b 25%, transparent 25%, transparent 75%, #64748b 75%);
            background-size: 8px 8px;
            background-position: 0 0, 4px 4px;
        }
        .prop-color-control .hex-input { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; text-transform: lowercase; }
        .swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 6px; }
        .swatch-gap { width: 1px; height: 14px; margin: 0 2px; background: #334155; }
        .swatch {
            width: 18px;
            height: 18px;
            padding: 0;
            border: 1px solid rgba(255, 255, 255, 0.18);
            border-radius: 4px;
            background: var(--swatch);
            cursor: pointer;
        }
        .swatch:hover { transform: scale(1.12); }
        .swatch.active { outline: 2px solid #38bdf8; outline-offset: 1px; }
        .swatch.is-transparent {
            background-color: #ffffff;
            background-image: linear-gradient(45deg, #cbd5e1 25%, transparent 25%, transparent 75%, #cbd5e1 75%), linear-gradient(45deg, #cbd5e1 25%, transparent 25%, transparent 75%, #cbd5e1 75%);
            background-size: 8px 8px;
            background-position: 0 0, 4px 4px;
        }
        .stroke-section { margin: 4px 0 10px; padding-top: 8px; border-top: 1px solid #1f2937; }
        .stroke-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; font-size: 0.7rem; color: #94a3b8; }
        .stroke-add {
            display: grid;
            place-items: center;
            width: 24px;
            height: 24px;
            border: 1px solid #334155;
            border-radius: 4px;
            background: #1e293b;
            color: #cbd5e1;
            cursor: pointer;
        }
        .stroke-add:hover { color: #ffffff; border-color: #38bdf8; }
        .stroke-add .material-symbols-outlined { font-size: 16px; }
        .typography .prop-row { gap: 8px; }
        .typo-icon { font-size: 14px; vertical-align: -3px; margin-right: 3px; color: #94a3b8; }
        .typo-toolbar { display: flex; gap: 8px; margin: 2px 0 10px; }
        .typo-toolbar .segmented { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid #334155; border-radius: 6px; background: #1e293b; }
        .typo-toolbar .segmented button { display: grid; place-items: center; min-width: 28px; height: 26px; padding: 0 6px; border: 0; border-radius: 4px; background: none; color: #cbd5e1; font: inherit; cursor: pointer; }
        .typo-toolbar .segmented button .material-symbols-outlined { font-size: 17px; }
        .typo-toolbar .segmented button:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
        .typo-toolbar .segmented button.active { color: #fff; background: rgba(56, 189, 248, 0.22); }
        .typo-hint { margin: 2px 0 6px; font-size: 0.68rem; line-height: 1.4; color: #64748b; }
        .link-btn { padding: 0; border: 0; background: none; color: #38bdf8; font: inherit; text-decoration: underline; cursor: pointer; }
        .page-settings .prop-section-title, .page-settings .prop-section-title .material-symbols-outlined { display: flex; align-items: center; gap: 6px; }
        .page-settings .prop-section-title .material-symbols-outlined { font-size: 16px; }
        .page-settings textarea { width: 100%; resize: vertical; }
        .char-count { float: right; font-weight: 400; color: #64748b; }
        .char-count.over { color: #f59e0b; }
        .shape-layer.group-layer.is-main-component { outline: 1.5px solid rgba(168, 85, 247, 0.9); }
        .shape-layer.group-layer.is-instance { outline: 1.5px dashed rgba(168, 85, 247, 0.8); }
        .component-section .prop-section-title { display: flex; align-items: center; gap: 6px; color: #c084fc; }
        .component-section .prop-section-title .material-symbols-outlined { font-size: 16px; }
        .component-actions { display: flex; gap: 6px; flex-wrap: wrap; }
        .component-actions .panel-btn { flex: 1; }
        .component-icon { width: 28px; text-align: center; font-size: 18px; color: #c084fc; }
        .style-pick-row { display: flex; gap: 6px; align-items: center; }
        .style-pick-row select { flex: 1; min-width: 0; }
        .style-swatches { margin-bottom: 4px; }
        .swatch.is-style { border-radius: 50%; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset; }
        .swatch.swatch-save { display: grid; place-items: center; background: none; border: 1px dashed #475569; color: #94a3b8; }
        .swatch.swatch-save .material-symbols-outlined { font-size: 14px; }
        .styles-manager { margin-bottom: 14px; }
        .styles-sub { margin: 8px 0 4px; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: #64748b; }
        .style-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
        .style-row .style-sample { width: 28px; text-align: center; font-size: 16px; color: #e5e5e5; }
        .style-row input[type="color"] { width: 28px; height: 22px; padding: 0; border: 1px solid #334155; border-radius: 4px; background: none; cursor: pointer; }
        .style-row .style-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 0.78rem; color: #e5e5e5; }
        .style-row .style-name small { font-size: 0.65rem; color: #64748b; }
        .style-row button { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 4px; background: none; color: #94a3b8; cursor: pointer; }
        .style-row button:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
        .style-row button .material-symbols-outlined { font-size: 16px; }
        .style-add { margin-top: 6px; }
        .linked-style { color: #38bdf8; font-weight: 500; }
        .rich-bar {
            position: fixed;
            z-index: 2000;
            display: flex;
            align-items: center;
            gap: 2px;
            padding: 4px;
            border: 1px solid var(--theme-border, rgba(89, 89, 89, 0.52));
            border-radius: 10px;
            background: var(--theme-surface, #262626);
            box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
            font: 500 13px Inter, Arial, sans-serif;
            color: #e5e5e5;
        }
        .rich-bar button { display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; font-size: 15px; cursor: pointer; }
        .rich-bar button:hover { background: rgba(255, 255, 255, 0.08); }
        .rich-bar button.active { background: rgba(56, 189, 248, 0.25); color: #fff; }
        .rich-bar button .material-symbols-outlined { font-size: 18px; }
        .rich-bar select, .rich-bar input[type="number"] { height: 28px; padding: 0 6px; border: 1px solid #3a3a3a; border-radius: 6px; background: #1a1a1a; color: inherit; font: inherit; }
        .rich-bar input[type="number"] { width: 58px; }
        .rich-bar input[type="color"] { width: 30px; height: 28px; padding: 0; border: 1px solid #3a3a3a; border-radius: 6px; background: none; cursor: pointer; }
        .rich-bar-sep { width: 1px; height: 20px; margin: 0 4px; background: #3a3a3a; }
        .link-strip { display: flex; align-items: center; gap: 6px; margin: 2px 0 10px; padding: 6px 8px; border: 1px solid rgba(56, 189, 248, 0.35); border-radius: 6px; background: rgba(56, 189, 248, 0.08); font-size: 0.72rem; color: #bae6fd; }
        .link-strip .material-symbols-outlined { font-size: 16px; }
        .link-strip span:nth-child(2) { flex: 1; }
        .layer-link { font-size: 14px; color: #38bdf8; margin-left: 4px; }
        .shape-layer.link-partner { outline: 1.5px dashed rgba(56, 189, 248, 0.9) !important; outline-offset: 2px; }
        .slice-mode { display: inline-flex; margin: 4px 0 8px; padding: 2px; border: 1px solid #334155; border-radius: 6px; background: #1e293b; }
        .slice-mode button { min-width: 56px; height: 26px; border: 0; border-radius: 4px; background: none; color: #cbd5e1; font: inherit; font-size: 0.72rem; cursor: pointer; }
        .slice-mode button.active { color: #fff; background: rgba(56, 189, 248, 0.22); }
        .slice-picker { display: block; margin: 4px auto 6px; overflow: visible; }
        .slice-piece { fill: rgba(148, 163, 184, 0.08); stroke: #64748b; stroke-width: 1px; vector-effect: non-scaling-stroke; stroke-dasharray: 3 3; cursor: pointer; outline: none; }
        .slice-piece:hover { fill: rgba(56, 189, 248, 0.25); }
        .slice-piece.kept { fill: #38bdf8; stroke: #0f172a; stroke-dasharray: none; }
        .slice-piece.kept:hover { fill: #7dd3fc; }
        .slice-piece:focus-visible { stroke: #fff; stroke-width: 2px; }
        .slice-outline { fill: none; pointer-events: none; }
        .slice-outline ellipse, .slice-outline rect { fill: none; stroke: #94a3b8; stroke-width: 1px; vector-effect: non-scaling-stroke; }
        .slice-actions { display: flex; justify-content: center; gap: 14px; font-size: 0.72rem; }
        .fx-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 4px 0 8px; }
        .fx-menu[hidden] { display: none; }
        .fx-menu button { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid #334155; border-radius: 6px; background: #1e293b; color: #cbd5e1; font: inherit; font-size: 0.72rem; cursor: pointer; text-align: left; }
        .fx-menu button:hover { border-color: #38bdf8; color: #fff; }
        .fx-menu .material-symbols-outlined { font-size: 16px; }
        .fx-row { display: flex; align-items: center; gap: 4px; padding: 2px 0; }
        .fx-row.open .fx-name { color: #fff; }
        .fx-row.off .fx-name { opacity: 0.45; }
        .fx-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 5px 4px; border: 0; border-radius: 6px; background: none; color: #cbd5e1; font: inherit; font-size: 0.78rem; text-align: left; cursor: pointer; }
        .fx-name:hover { background: rgba(255, 255, 255, 0.05); }
        .fx-name .material-symbols-outlined { font-size: 16px; color: #94a3b8; }
        .fx-name small { margin-left: auto; font-size: 0.65rem; color: #64748b; white-space: nowrap; }
        .fx-icon { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 5px; background: none; color: #94a3b8; cursor: pointer; }
        .fx-icon:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
        .fx-icon .material-symbols-outlined { font-size: 16px; }
        span.fx-icon, .fx-eye { width: 26px; text-align: center; font-size: 16px; color: #94a3b8; }
        .fx-editor { margin: 4px 0 10px; padding: 10px; border: 1px solid #263244; border-radius: 8px; background: rgba(15, 23, 42, 0.5); }
        .shadow-mixer.no-pad { grid-template-columns: 1fr; }
        .fx-blend { margin-top: 8px; }
        .gradient-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
        .gradient-head output { font-size: 0.72rem; color: #cbd5e1; font-variant-numeric: tabular-nums; }
        .gradient-dial { position: relative; width: 36px; height: 36px; border: 1px solid #334155; border-radius: 50%; background: #0f172a; cursor: grab; touch-action: none; }
        .gradient-dial:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }
        .gradient-dial-hand { position: absolute; left: 50%; top: 50%; width: 2px; height: 15px; margin-left: -1px; margin-top: -15px; background: #38bdf8; border-radius: 1px; transform-origin: 50% 100%; }
        .gradient-preview { height: 14px; margin-bottom: 8px; border-radius: 4px; }
        .gradient-stop { display: grid; grid-template-columns: 28px 1fr 34px 22px; align-items: center; gap: 6px; margin-bottom: 4px; }
        .gradient-stop input[type="color"] { width: 28px; height: 22px; padding: 0; border: 1px solid #334155; border-radius: 4px; background: none; cursor: pointer; }
        .gradient-stop input[type="range"] { width: 100%; margin: 0; }
        .gradient-stop output { font-size: 0.68rem; color: #cbd5e1; text-align: right; }
        .gradient-stop button { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; background: none; color: #94a3b8; cursor: pointer; }
        .gradient-stop button .material-symbols-outlined { font-size: 14px; }
        .fx-editor .link-btn { font-size: 0.72rem; }
        .shadow-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 6px 0 10px; }
        .shadow-preset {
            display: flex; flex-direction: column; align-items: center; gap: 6px;
            padding: 4px 4px 5px; border: 1px solid #334155; border-radius: 6px;
            background: #1e293b; color: #cbd5e1; font: inherit; font-size: 0.65rem; cursor: pointer;
        }
        .shadow-preset:hover { border-color: #38bdf8; color: #ffffff; }
        .shadow-preset.active { border-color: #38bdf8; background: rgba(56, 189, 248, 0.12); color: #ffffff; }
        .shadow-preset-stage { display: grid; place-items: center; align-self: stretch; height: 34px; border-radius: 4px; background: #e2e8f0; }
        .shadow-preset-chip { width: 24px; height: 16px; border-radius: 3px; background: #ffffff; }
        .shadow-mixer { display: grid; grid-template-columns: 76px 1fr; gap: 10px; align-items: start; }
        .shadow-pad {
            position: relative; width: 76px; height: 76px; border-radius: 6px; cursor: crosshair; touch-action: none;
            border: 1px solid #334155;
            background:
                linear-gradient(#334155, #334155) center / 1px 100% no-repeat,
                linear-gradient(#334155, #334155) center / 100% 1px no-repeat,
                #0f172a;
        }
        .shadow-pad:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }
        .page-colour-pop .swatch:focus-visible, .shadow-section .swatch:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }
        .shadow-pad-sun { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 14px; color: #475569; pointer-events: none; }
        .shadow-pad-dot {
            position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
            background: #38bdf8; box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25); pointer-events: none;
        }
        .shadow-sliders { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
        .shadow-slider { display: grid; grid-template-columns: 52px 1fr 34px; align-items: center; gap: 6px; font-size: 0.68rem; color: #94a3b8; }
        .shadow-slider input[type="range"] { width: 100%; min-width: 0; margin: 0; }
        .shadow-slider output { text-align: right; color: #cbd5e1; font-variant-numeric: tabular-nums; }
        .shadow-offset-readout { margin: 4px 0 8px; font-size: 0.65rem; color: #64748b; font-variant-numeric: tabular-nums; }
        .shadow-colour { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
        .shadow-colour input[type="color"] { width: 28px; height: 24px; padding: 0; border: 1px solid #334155; border-radius: 4px; background: none; cursor: pointer; }
        .shadow-colour .swatches { margin: 0; }
        .shadow-inside { margin-top: 8px; }
        .align-bar { position: fixed; }
        .align-bar .bar-colour[hidden] { display: none; }
        .align-bar .bar-colour.open { background: rgba(56, 189, 248, 0.15); }
        .bar-chip {
            display: block;
            width: 18px;
            height: 18px;
            border: 1px solid rgba(255, 255, 255, 0.35);
            border-radius: 50%;
            background: var(--chip);
        }
        .bar-chip.is-stroke { background: transparent; border: 4px solid var(--chip); }
        .bar-chip.is-none { background: linear-gradient(135deg, transparent 45%, #ef4444 45%, #ef4444 55%, transparent 55%), #ffffff; border: 1px solid rgba(255, 255, 255, 0.35); }
        .bar-chip.is-mixed { background: conic-gradient(#ef4444, #f59e0b, #16a34a, #2563eb, #a855f7, #ef4444); border-width: 1px; }
        .bar-colour-pop {
            position: absolute;
            top: calc(100% + 8px);
            right: 0;
            width: 236px;
            padding: 10px;
            border: 1px solid var(--theme-border, rgba(89, 89, 89, 0.52));
            border-radius: 10px;
            background: var(--theme-surface, #262626);
            box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
        }
        .bar-colour-pop[hidden] { display: none; }
        .bar-colour-pop .swatches { margin-top: 6px; }
        .bar-colour-pop .swatch { width: 20px; height: 20px; }
        .bar-pop-title { display: flex; justify-content: space-between; font: 600 0.72rem Inter, Arial, sans-serif; color: #e5e5e5; }
        .bar-pop-title span { font-weight: 500; color: #8a8a8a; }
        .bar-pop-custom {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 8px;
            font: 500 0.72rem Inter, Arial, sans-serif;
            color: #cbd5e1;
            cursor: pointer;
        }
        .bar-pop-custom input { width: 28px; height: 22px; padding: 0; border: 1px solid #3a3a3a; border-radius: 4px; background: none; cursor: pointer; }
        .bar-pop-widths { display: flex; gap: 4px; margin-top: 8px; }
        .align-bar .bar-pop-widths button {
            display: flex;
            flex: 1;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            width: auto;
            height: auto;
            padding: 6px 0;
            border: 1px solid #3a3a3a;
            font: 500 0.68rem Inter, Arial, sans-serif;
            color: #cbd5e1;
        }
        .bar-pop-widths button span { display: block; width: 28px; background: currentColor; }
        .align-bar .bar-colour-pop .swatch {
            display: block;
            width: 20px;
            height: 20px;
            padding: 0;
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 4px;
            background: var(--swatch);
        }
        .align-bar .bar-colour-pop .swatch.is-transparent {
            background-color: #ffffff;
            background-image: linear-gradient(45deg, #cbd5e1 25%, transparent 25%, transparent 75%, #cbd5e1 75%), linear-gradient(45deg, #cbd5e1 25%, transparent 25%, transparent 75%, #cbd5e1 75%);
            background-size: 8px 8px;
            background-position: 0 0, 4px 4px;
        }
        .align-bar .bar-colour-pop .swatch.active { outline: 2px solid #38bdf8; outline-offset: 1px; }
        .align-bar .bar-colour-pop .swatch:hover { transform: scale(1.12); }
        .layer-item.reveal-flash {
            animation: layer-reveal 0.9s ease-out;
        }
        @keyframes layer-reveal {
            0%, 35% { box-shadow: inset 0 0 0 2px #0d99ff; background: rgba(13, 153, 255, 0.35); }
            100% { box-shadow: inset 0 0 0 2px transparent; }
        }
        @media (prefers-reduced-motion: reduce) {
            .layer-item.reveal-flash { animation: none; box-shadow: inset 0 0 0 2px #0d99ff; }
        }
        .shape-layer.group-entered {
            outline: 1.5px dashed #0d99ff;
            outline-offset: 3px;
        }
        :root {
            --theme-bg: #131313;
            --theme-surface: #222222; 
            --theme-panel: rgba(22, 22, 22, 0.6);
            --theme-border: rgba(255, 255, 255, 0.07);
            --theme-glow: transparent;
            --theme-text: #ededed;
            --theme-subtle: #a3a3a3;
            --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.05' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.7 -0.24'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
            --grain-mask:
                linear-gradient(103deg, rgba(0, 0, 0, 0.35) 4%, #000 16%, rgba(0, 0, 0, 0.3) 27%,
                    #000 38%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.85) 63%, rgba(0, 0, 0, 0.3) 76%, rgba(0, 0, 0, 0.55) 100%);
            --bands:
                linear-gradient(103deg, transparent 4%, rgba(255, 255, 255, 0.06) 16%, transparent 27%,
                    rgba(255, 255, 255, 0.085) 38%, transparent 50%, rgba(255, 255, 255, 0.05) 63%, transparent 76%),
                radial-gradient(1100px 720px at 22% 28%, rgba(255, 255, 255, 0.06), transparent 62%);
        }
        body::before {
            background: var(--bands), linear-gradient(160deg, #181818 0%, #121212 55%, #0e0e0e 100%);
        }
        body::after {
            opacity: 0.88;
            mix-blend-mode: soft-light;
            background: var(--grain), var(--grain);
            background-size: 233px 233px, 151px 151px;
            background-position: 0 0, 67px 41px;
            -webkit-mask-image: var(--grain-mask);
            mask-image: var(--grain-mask);
        }
        .toolbar { background-color: rgba(18, 18, 18, 0.6); }
        .canvas-wrapper {
            background: transparent;
            box-shadow: none;
        }
        .toolbar { border-bottom: 1px solid var(--theme-border); }
        .sidebar { border-left: 1px solid var(--theme-border); }
        .status-bar { border-top: 1px solid var(--theme-border); }
        .panel { background: transparent; }
        .layer-item { background: transparent; }
        .layer-item:hover { background: rgba(255, 255, 255, 0.05); }
        .layer-item.active { background: rgba(255, 255, 255, 0.09); border-color: transparent; }
        .align-bar {
            background: var(--grain), #1d1d1d;
            background-size: 180px 180px, auto;
            background-blend-mode: soft-light, normal;
            border-color: rgba(255, 255, 255, 0.1);
        }
        .toolbar .tool-btn .tool-btn-word {
            font-size: 10.5px;
            font-weight: 600;
            letter-spacing: 0.03em;
            line-height: 1;
        }
        .toolbar .overflow-toggle { gap: 5px; }
        .toolbar .overflow-toggle .tool-btn-word { position: relative; top: 1px; }
        .toolbar #overflowToggle, .toolbar #structureToggle { padding-left: 6px; padding-right: 6px; }
        .panel-btn:disabled,
        .panel-btn:disabled:hover {
            opacity: 0.35;
            cursor: default;
            background: transparent;
        }
        .layers-removed { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--theme-border); }
        .layers-removed-title { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 0.72rem; font-weight: 600; color: var(--theme-subtle); }
        .layers-removed-title .material-symbols-outlined { font-size: 16px; }
        .layers-removed-title > span:not(.material-symbols-outlined) { padding: 0 6px; border-radius: 8px; background: var(--theme-surface); font-size: 0.68rem; }
        .layers-removed-all { margin-left: auto; }
        .layers-removed-row { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 6px; font-size: 0.78rem; color: var(--theme-subtle); opacity: 0.85; }
        .layers-removed-row:hover { background: var(--theme-surface); opacity: 1; }
        .layers-removed-row .material-symbols-outlined { flex: none; width: 1em; overflow: hidden; font-size: 15px; }
        .layers-removed-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: line-through; text-decoration-color: rgba(184, 184, 184, 0.5); }
        .layers-removed button { flex: none; padding: 3px 8px; border: 1px solid var(--theme-border); border-radius: 999px; background: transparent; color: var(--theme-text); font: 600 0.68rem/1.2 Inter, Arial, sans-serif; cursor: pointer; }
        .layers-removed button:hover { background: #0d99ff; border-color: #0d99ff; color: #ffffff; }
        .layers-removed button:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }
        .version-history-overlay { position: fixed; inset: 0; z-index: 9500; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, 0.55); }
        .version-history { width: min(100%, 440px); max-height: min(80vh, 640px); display: flex; flex-direction: column; gap: 10px; padding: 18px; border: 1px solid var(--theme-border); border-radius: 16px; background: #161616; color: #f2f2f2; font-family: Inter, Arial, sans-serif; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
        .version-history-head { display: flex; align-items: center; justify-content: space-between; font-size: 0.95rem; }
        .version-history-note { margin: 0; color: #9a9a9a; font-size: 0.78rem; }
        .version-history-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
        .version-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid #2a2a2a; border-radius: 10px; }
        .version-row div { display: flex; flex-direction: column; gap: 2px; font-size: 0.82rem; }
        .version-row span { color: #9a9a9a; font-size: 0.74rem; }
        .version-restore { padding: 6px 12px; border: 0; border-radius: 8px; background: #0d99ff; color: #fff; font: 600 0.78rem Inter, Arial, sans-serif; cursor: pointer; }
        .shortcuts-overlay { position: fixed; inset: 0; z-index: 9500; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, 0.55); }
        .shortcuts { width: min(100%, 760px); max-height: min(85vh, 760px); display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 1px solid var(--theme-border); border-radius: 16px; background: #161616; color: #f2f2f2; font-family: Inter, Arial, sans-serif; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
        .shortcuts-head { display: flex; align-items: center; gap: 12px; font-size: 0.95rem; }
        .shortcuts-head input { flex: 1; height: 34px; padding: 0 10px; border: 1px solid #2f2f2f; border-radius: 8px; background: #0f0f0f; color: #f2f2f2; font: 0.82rem Inter, Arial, sans-serif; }
        .shortcuts-body { columns: 2 300px; column-gap: 24px; overflow-y: auto; }
        .shortcuts-body section { break-inside: avoid; margin-bottom: 14px; }
        .shortcuts-body h3 { margin: 0 0 6px; color: #9a9a9a; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
        .shortcut-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid #222; font-size: 0.8rem; }
        .shortcut-keys { display: flex; align-items: center; gap: 3px; flex-shrink: 0; }
        .shortcut-keys kbd { padding: 2px 6px; border: 1px solid #3a3a3a; border-bottom-width: 2px; border-radius: 5px; background: #222; color: #f2f2f2; font: 600 0.72rem Inter, Arial, sans-serif; }
        .shortcut-plus, .shortcut-or { color: #7a7a7a; font-size: 0.7rem; }
        .shortcut-word { color: #b8b8b8; font-size: 0.74rem; }
        .shortcut-none { color: #9a9a9a; font-size: 0.82rem; }
.rich-bar { flex-wrap: wrap; }
.rich-link-row { display: flex; gap: 6px; align-items: center; flex-basis: 100%; padding-top: 6px; }
.rich-link-row[hidden] { display: none; }
.rich-link-row input { flex: 1; min-width: 220px; height: 28px; padding: 0 8px; border: 1px solid #3a3a3a; border-radius: 6px; background: #1a1a1a; color: inherit; font: inherit; }
.rich-link-row button { min-width: auto; padding: 0 10px; font-size: 13px; }
.rich-link-row button[hidden] { display: none; }
.start-overlay { position: fixed; inset: 0; z-index: 9400; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, 0.6); }
.start { position: relative; width: min(100%, 960px); max-height: min(90vh, 820px); overflow: auto; padding: 28px; border: 1px solid var(--theme-border); border-radius: 18px; background: #161616; color: #f2f2f2; font-family: Inter, Arial, sans-serif; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.start h2 { margin: 0 0 6px; font-size: 26px; font-weight: 700; }
.start-lead { margin: 0 0 20px; color: #a3a3a3; font-size: 14px; }
.start-close { position: absolute; top: 16px; right: 16px; }
.start-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.start-card { display: flex; flex-direction: column; gap: 4px; padding: 10px 10px 14px; border: 1px solid #2c2c2c; border-radius: 14px; background: #1d1d1d; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color 0.15s, transform 0.15s; }
.start-card:hover, .start-card:focus-visible { border-color: #38bdf8; transform: translateY(-2px); outline: none; }
.start-card img, .start-guided-art { width: 100%; aspect-ratio: 16 / 10; margin-bottom: 8px; border-radius: 8px; object-fit: cover; background: #111; }
.start-guided-art { display: grid; place-items: center; background: linear-gradient(135deg, #ff4d2e 0%, #ffd23f 50%, #8fe0bf 100%); color: #111; }
.start-guided-art .material-symbols-outlined { font-size: 56px; }
.start-card strong { padding: 0 4px; font-size: 15px; }
.start-card > span:last-child { padding: 0 4px; color: #a3a3a3; font-size: 13px; line-height: 1.4; }
.start-card.loading { opacity: 0.6; cursor: progress; }
.start-empty { display: block; margin: 18px auto 0; padding: 8px 14px; border: 0; background: none; color: #a3a3a3; font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.start-empty:hover { color: #f2f2f2; }
@media (max-width: 600px) { .start-overlay { padding: 16px; } .start { padding: 20px 16px; } .start-grid { grid-template-columns: 1fr; } }
.guide-card { position: fixed; left: 50%; bottom: 44px; z-index: 9300; width: min(calc(100vw - 32px), 380px); transform: translateX(-50%); padding: 16px 18px; border: 1px solid #38bdf8; border-radius: 14px; background: #161616; color: #f2f2f2; font: 14px/1.45 Inter, Arial, sans-serif; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); }
.guide-card strong { display: block; margin: 2px 0 4px; font-size: 16px; }
.guide-card p { margin: 0; color: #cfcfcf; }
.guide-card kbd { padding: 1px 6px; border: 1px solid #3a3a3a; border-radius: 5px; background: #222; font: 600 12px Inter, Arial, sans-serif; }
.guide-count { color: #38bdf8; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.guide-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.guide-actions button { height: 30px; padding: 0 12px; border: 1px solid #3a3a3a; border-radius: 8px; background: none; color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
.guide-actions .guide-next { border-color: #38bdf8; background: #38bdf8; color: #0b0b0b; font-weight: 600; }
.guide-target { outline: 2px solid #38bdf8 !important; outline-offset: 2px; border-radius: 8px; animation: guide-pulse 1.4s ease-in-out infinite; }
@keyframes guide-pulse { 50% { outline-color: rgba(56, 189, 248, 0.25); } }
@media (prefers-reduced-motion: reduce) { .guide-target { animation: none; } }
.rich-bar [hidden] { display: none !important; } 
.rich-bar[hidden] { display: none !important; } 
