/* ToolKnit Image Editor — card-based layout, minimal dividers. Scoped with the .tie- prefix. */
.tie-page{--tie-bg:#0a0a0a;--tie-card:#121212;--tie-card-2:#181818;--tie-card-3:#1f1f1f;--tie-text:#f2f2f2;--tie-muted:#9a9a9a;--tie-faint:#6b6b6b;--tie-accent:#f5f5f5;--tie-guide:#ff4fa3;--tie-radius:18px;--tie-ring:0 0 0 1px rgba(255,255,255,.06)}
.tie-page [hidden]{display:none!important}
.tie-sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.tie-card{background:var(--tie-card);border-radius:var(--tie-radius);box-shadow:var(--tie-ring);padding:26px}
.tie-eyebrow{font-size:10px;letter-spacing:.19em;text-transform:uppercase;color:#a3a3a3;font-weight:600;margin:0 0 10px}
.tie-muted{color:var(--tie-muted);font-size:13px;line-height:1.75;margin:8px 0 0}
.tie-h2{font-size:clamp(1.35rem,2.6vw,1.9rem);font-weight:700;letter-spacing:-.02em;color:#fff;line-height:1.25;margin:0 0 22px;text-wrap:balance}
.tie-btn-lg{min-height:48px;padding:12px 22px;font-size:13px!important;border-radius:13px}
.tie-checker{background-color:#fff;background-image:linear-gradient(45deg,#d9d9d9 25%,transparent 25%),linear-gradient(-45deg,#d9d9d9 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#d9d9d9 75%),linear-gradient(-45deg,transparent 75%,#d9d9d9 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0}

/* Landing */
.tie-start{padding-top:10px;padding-bottom:40px}
.tie-start-grid{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr);gap:18px}
.tie-card-create h2,.tie-card-open h2{font-size:22px;font-weight:700;color:#fff;margin:0;letter-spacing:-.01em}
.tie-quick{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:20px 0}
.tie-quick-btn{display:flex;flex-direction:column;align-items:center;gap:8px;padding:16px 8px 12px;border-radius:14px;background:var(--tie-card-2);border:0;color:#e8e8e8;cursor:pointer;transition:background .2s,transform .2s}
.tie-quick-btn:hover{background:var(--tie-card-3);transform:translateY(-2px)}
.tie-quick-shape{display:flex;align-items:center;justify-content:center;width:40px;height:36px}
.tie-quick-shape::before{content:"";width:var(--w);height:var(--h);border-radius:4px;background:rgba(255,255,255,.14);box-shadow:inset 0 0 0 1.5px rgba(255,255,255,.55)}
.tie-quick-name{font-size:12px;font-weight:600;text-align:center;line-height:1.35}
.tie-quick-dims{font-family:'JetBrains Mono',monospace;font-size:10.5px;color:var(--tie-faint)}
.tie-card-open{display:flex;flex-direction:column}
.tie-drop{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:6px;padding:28px 18px;border-radius:16px;background:var(--tie-card-2);cursor:pointer;outline-offset:4px;transition:background .2s,box-shadow .2s}
.tie-drop:hover,.tie-drop.is-dragover{background:var(--tie-card-3);box-shadow:0 0 0 2px rgba(255,255,255,.28)}
.tie-drop-icon{display:flex;width:58px;height:58px;align-items:center;justify-content:center;border-radius:17px;background:#232323;color:#dcdcdc;margin-bottom:8px}
.tie-drop .tie-muted{max-width:330px;margin-bottom:14px}
.tie-fake-btn{pointer-events:none}
.tie-link-btn{margin-top:12px;align-self:center;background:none;border:0;color:var(--tie-muted);font-size:12.5px;font-weight:600;cursor:pointer;padding:6px 8px;border-radius:8px;text-decoration:underline;text-underline-offset:3px}
.tie-link-btn:hover{color:#fff}
.tie-resume{display:flex;align-items:center;gap:18px;margin-top:18px;padding:18px 20px}
.tie-resume-thumb{width:112px;height:84px;object-fit:contain;border-radius:10px;background:#1c1c1c;flex-shrink:0}
.tie-resume-text{flex:1;min-width:0}
.tie-resume-text h3{margin:0;font-size:15px;font-weight:600;color:#fff}
.tie-resume-text .tie-muted{margin-top:4px;overflow-wrap:anywhere}
.tie-resume-actions{display:flex;gap:10px;flex-wrap:wrap}
.tie-loading{display:flex;align-items:center;justify-content:center;gap:10px;margin:16px 0 0;color:#cfcfcf;font-size:13px}
.tie-spinner{width:18px;height:18px;border-radius:50%;border:2px solid rgba(255,255,255,.2);border-top-color:#fff;animation:tie-spin .8s linear infinite;flex-shrink:0}
@keyframes tie-spin{to{transform:rotate(360deg)}}
.tie-section{padding-top:36px;padding-bottom:36px}
.tie-feature-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.tie-feature{padding:22px}
.tie-feature-icon{display:flex;width:42px;height:42px;align-items:center;justify-content:center;border-radius:13px;background:var(--tie-card-3);color:#e6e6e6;margin-bottom:14px}
.tie-feature-icon svg{width:21px;height:21px}
.tie-feature h3,.tie-step h3,.tie-mini h3{font-size:15px;font-weight:600;color:#fff;margin:0 0 6px}
.tie-feature p,.tie-step p,.tie-mini p{font-size:13px;line-height:1.7;color:var(--tie-muted);margin:0}
.tie-boundary{font-size:12px;line-height:1.7;color:var(--tie-faint);margin:18px 2px 0}
.tie-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.tie-step-no{display:inline-flex;font-family:'JetBrains Mono',monospace;font-size:12px;font-weight:600;color:#111;background:#f2f2f2;border-radius:8px;padding:3px 8px;margin-bottom:14px}
.tie-split{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);gap:40px;padding:34px}
.tie-split-intro .tie-h2{margin-bottom:0}
.tie-split-items{display:grid;gap:12px;margin:0;padding:0;list-style:none}
.tie-mini{background:var(--tie-card-2);border-radius:14px;padding:16px 18px;min-width:0}
.tie-tip-list .tie-mini{font-size:13px;line-height:1.7;color:#cfcfcf}
.tie-faq{display:grid;gap:10px}
.tie-faq-item{background:var(--tie-card);border-radius:14px;box-shadow:var(--tie-ring)}
.tie-faq-item summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 20px;cursor:pointer;list-style:none;font-size:14.5px;font-weight:600;color:#f0f0f0;border-radius:14px}
.tie-faq-item summary::-webkit-details-marker{display:none}
.tie-chevron{flex-shrink:0;color:#8a8a8a;transition:transform .26s}
.tie-faq-item[open]:not(.is-closing) .tie-chevron{transform:rotate(180deg)}
.tie-faq-a{padding:0 20px 18px}
.tie-faq-a p{margin:0;font-size:13.5px;line-height:1.8;color:var(--tie-muted)}
.tie-related{position:relative;padding:48px 0 64px}
@media (max-width:900px){.tie-start-grid,.tie-split{grid-template-columns:1fr}.tie-split{gap:22px;padding:24px}.tie-feature-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.tie-steps{grid-template-columns:1fr}}
@media (max-width:560px){.tie-card{padding:20px}.tie-quick{grid-template-columns:repeat(2,minmax(0,1fr))}.tie-feature-grid{grid-template-columns:1fr}.tie-resume{flex-wrap:wrap}.tie-resume-actions{width:100%}.tie-resume-actions .metadata-btn{flex:1}}

/* App mode: hide site floating widgets and lock scrolling */
html.tie-app-mode,body.tie-app-mode{overflow:hidden!important;overscroll-behavior:none}
html.tie-app-mode #tk-quick-actions,html.tie-app-mode #tk-back-to-top,html.tie-app-mode #tk-floating-nav,html.tie-app-mode .tk-sound-toggle{display:none!important}

/* Shared small controls */
.tie-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:10px;border:0;background:transparent;color:#d4d4d4;cursor:pointer;transition:background .15s,color .15s;flex-shrink:0}
.tie-icon-btn:hover:not(:disabled){background:rgba(255,255,255,.08);color:#fff}
.tie-icon-btn:disabled{opacity:.32;cursor:default}
.tie-icon-btn[aria-pressed="true"]{background:#f2f2f2;color:#111}
.tie-pill-btn{display:inline-flex;align-items:center;gap:8px;min-height:36px;padding:7px 14px;border-radius:999px;border:0;background:var(--tie-card-3);color:#e8e8e8;font-size:12.5px;font-weight:600;cursor:pointer;transition:background .15s}
.tie-pill-btn:hover{background:#2a2a2a}
.tie-pill-primary{background:#f2f2f2;color:#111}
.tie-pill-primary:hover{background:#fff}
.tie-chips{display:flex;flex-wrap:wrap;gap:8px}
.tie-ratio-chip,.tie-radio span{display:inline-flex;align-items:center;min-height:34px;padding:6px 12px;border-radius:999px;background:var(--tie-card-3);color:#d6d6d6;font-size:12px;font-weight:600;cursor:pointer;border:0;transition:background .15s,color .15s;font-family:inherit}
.tie-ratio-chip:hover,.tie-radio span:hover{background:#2b2b2b}
.tie-ratio-chip[aria-pressed="true"],.tie-radio input:checked+span{background:#f2f2f2;color:#111}
.tie-radio{position:relative;display:inline-flex}
.tie-radio input{position:absolute;opacity:0;inset:0;margin:0;cursor:pointer}
.tie-radio input:focus-visible+span{outline:2px solid #fff;outline-offset:2px}
.tie-field{display:flex;flex-direction:column;gap:6px;min-width:0;flex:1}
.tie-field>span,.tie-field-label{font-size:11.5px;font-weight:600;color:#bdbdbd;margin:0}
.tie-field-label{margin:16px 0 8px}
.tie-field input,.tie-field select,.tie-prop-input,.tie-prop-select{width:100%;min-height:40px;padding:8px 12px;border-radius:10px;border:0;background:#0c0c0c;color:#f4f4f4;font-size:13px;font-family:inherit;box-shadow:inset 0 0 0 1px rgba(255,255,255,.08)}
.tie-field input:focus,.tie-field select:focus,.tie-prop-input:focus,.tie-prop-select:focus{outline:none;box-shadow:inset 0 0 0 1.5px rgba(255,255,255,.55)}
.tie-color{width:40px;height:34px;padding:2px;border-radius:10px;border:0;background:#0c0c0c;box-shadow:inset 0 0 0 1px rgba(255,255,255,.1);cursor:pointer}
.tie-color:disabled{opacity:.35}
.tie-range{width:100%;accent-color:#f2f2f2}
.tie-check{display:flex;align-items:center;gap:10px;font-size:12.5px;color:#d6d6d6;cursor:pointer}
.tie-check input{width:16px;height:16px;accent-color:#f2f2f2}

/* Picker (stage 2) */
.tie-picker{position:fixed;inset:0;z-index:9000;background:var(--tie-bg);display:flex;flex-direction:column;color:var(--tie-text);color-scheme:dark}
.tie-picker-body,.tie-preset-groups,.tie-picker-side,.tie-props-body,.tie-layer-list,.tie-history-list,.tie-cmd-list,.tie-dialog:not(.tie-light-dialog){scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.18) transparent}
.tie-picker-body::-webkit-scrollbar,.tie-preset-groups::-webkit-scrollbar,.tie-picker-side::-webkit-scrollbar,.tie-props-body::-webkit-scrollbar,.tie-layer-list::-webkit-scrollbar,.tie-history-list::-webkit-scrollbar,.tie-cmd-list::-webkit-scrollbar,.tie-dialog:not(.tie-light-dialog)::-webkit-scrollbar{width:7px;height:7px}
.tie-picker-body::-webkit-scrollbar-track,.tie-preset-groups::-webkit-scrollbar-track,.tie-picker-side::-webkit-scrollbar-track,.tie-props-body::-webkit-scrollbar-track,.tie-layer-list::-webkit-scrollbar-track,.tie-history-list::-webkit-scrollbar-track,.tie-cmd-list::-webkit-scrollbar-track,.tie-dialog:not(.tie-light-dialog)::-webkit-scrollbar-track{background:transparent}
.tie-picker-body::-webkit-scrollbar-thumb,.tie-preset-groups::-webkit-scrollbar-thumb,.tie-picker-side::-webkit-scrollbar-thumb,.tie-props-body::-webkit-scrollbar-thumb,.tie-layer-list::-webkit-scrollbar-thumb,.tie-history-list::-webkit-scrollbar-thumb,.tie-cmd-list::-webkit-scrollbar-thumb,.tie-dialog:not(.tie-light-dialog)::-webkit-scrollbar-thumb{background:rgba(255,255,255,.18);border-radius:999px;border:1.5px solid transparent;background-clip:padding-box}
.tie-picker-body::-webkit-scrollbar-thumb:hover,.tie-preset-groups::-webkit-scrollbar-thumb:hover,.tie-picker-side::-webkit-scrollbar-thumb:hover,.tie-props-body::-webkit-scrollbar-thumb:hover,.tie-layer-list::-webkit-scrollbar-thumb:hover,.tie-history-list::-webkit-scrollbar-thumb:hover,.tie-cmd-list::-webkit-scrollbar-thumb:hover,.tie-dialog:not(.tie-light-dialog)::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.34);border:1.5px solid transparent;background-clip:padding-box}
.tie-picker-top{display:flex;align-items:center;gap:14px;padding:14px 20px}
.tie-picker-top h2{flex:1;text-align:center;margin:0;font-size:17px;font-weight:700}
.tie-picker-spacer{width:90px}
.tie-picker-body{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) 380px;gap:18px;padding:0 20px 20px}
.tie-preset-groups{overflow:auto;padding-right:6px;display:grid;gap:16px;align-content:start}
.tie-preset-group{background:var(--tie-card);border-radius:var(--tie-radius);padding:18px 18px 20px}
.tie-preset-group h3{margin:0 0 12px;font-size:13px;font-weight:600;color:#cfcfcf}
.tie-preset-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:10px}
.tie-preset{display:flex;flex-direction:column;align-items:center;gap:6px;padding:14px 8px 12px;border-radius:14px;border:0;background:var(--tie-card-2);color:#e6e6e6;cursor:pointer;transition:background .15s,transform .15s,box-shadow .15s;font-family:inherit}
.tie-preset:hover{background:var(--tie-card-3);transform:translateY(-1px)}
.tie-preset[aria-pressed="true"]{box-shadow:0 0 0 2px #f2f2f2;background:#232323}
.tie-preset-shape{display:flex;align-items:center;justify-content:center;width:52px;height:48px}
.tie-preset-shape span{border-radius:4px;background:rgba(255,255,255,.12);box-shadow:inset 0 0 0 1.5px rgba(255,255,255,.5)}
.tie-preset-name{font-size:12px;font-weight:600;text-align:center;line-height:1.35}
.tie-preset-dims{font-family:'JetBrains Mono',monospace;font-size:10.5px;color:var(--tie-faint)}
.tie-picker-side{display:flex;flex-direction:column;gap:16px;overflow:auto;padding-right:4px}
.tie-custom h3{margin:0;font-size:15px;font-weight:600}
.tie-custom,.tie-preview-card{padding:20px}
.tie-dim-row{display:flex;align-items:flex-end;gap:8px;margin-top:14px}
.tie-dim-row-2{align-items:flex-end}
.tie-dim-row-2 .tie-field:first-child{min-width:84px}
.tie-picker-act{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:40px;padding:0 11px;border-radius:10px;border:0;background:var(--tie-card-3);color:#e2e2e2;font-size:12px;font-weight:600;cursor:pointer;font-family:inherit;white-space:nowrap;flex-shrink:0;transition:background .15s,color .15s}
.tie-picker-act:hover{background:#2d2d2d;color:#fff}
.tie-picker-act[aria-pressed="true"]{background:#f2f2f2;color:#111}
.tie-lock .tie-lock-on{display:none}
.tie-lock[aria-pressed="true"] .tie-lock-on{display:block}
.tie-lock[aria-pressed="true"] .tie-lock-off{display:none}
.tie-bg-chips{align-items:center}
.tie-preview-stage{display:flex;align-items:center;justify-content:center;height:200px;border-radius:14px;background:#0b0b0b}
.tie-preview-box{border-radius:3px;box-shadow:0 8px 30px rgba(0,0,0,.5);transition:width .2s,height .2s}
.tie-preview-px{text-align:center;font-family:'JetBrains Mono',monospace;font-size:13px;color:#e6e6e6;margin:12px 0 0}
.tie-picker-msg{min-height:20px;font-size:12px;line-height:1.6;margin:8px 0 12px;color:var(--tie-muted)}
.tie-picker-msg[data-level="warn"]{color:#f5c26b}
.tie-picker-msg[data-level="error"]{color:#ff8d8d}
.tie-preview-card .tie-btn-lg{width:100%}
@media (max-width:900px){.tie-picker-body{grid-template-columns:1fr;overflow:auto}.tie-preset-groups{overflow:visible;padding-right:0}.tie-picker-side{overflow:visible;padding-right:0}.tie-picker-spacer{display:none}}

/* Editor (stage 3) */
.tie-editor{position:fixed;inset:0;z-index:9000;display:flex;flex-direction:column;background:#070707;color:var(--tie-text);font-family:'Space Grotesk',system-ui,sans-serif;padding:10px;gap:10px;color-scheme:dark}
.tie-panel{background:var(--tie-card);border-radius:16px;box-shadow:var(--tie-ring)}
.tie-top{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:64px;padding:8px 14px;background:var(--tie-card);border-radius:18px;box-shadow:var(--tie-ring)}
.tie-top-group{display:flex;align-items:center;gap:6px;min-width:0}
.tie-top-group:first-child{flex:1}
.tie-top-end{flex:1;justify-content:flex-end;gap:8px}
.tie-top-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:38px;padding:0 12px;border-radius:11px;border:0;background:var(--tie-card-2);color:#dedede;font-size:12.5px;font-weight:600;cursor:pointer;font-family:inherit;white-space:nowrap;flex-shrink:0;transition:background .15s,color .15s}
.tie-top-btn:hover:not(:disabled){background:var(--tie-card-3);color:#fff}
.tie-top-btn:disabled{opacity:.34;cursor:default}
.tie-title-stack{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:2px;min-width:0;margin-left:4px}
.tie-name{min-width:90px;width:min(240px,22vw);height:28px;padding:2px 8px;border-radius:8px;border:0;background:transparent;color:#fff;font-size:14.5px;font-weight:700;font-family:inherit}
.tie-name:hover{background:rgba(255,255,255,.06)}
.tie-name:focus{outline:none;background:#0c0c0c;box-shadow:inset 0 0 0 1.5px rgba(255,255,255,.45)}
.tie-save-state{display:inline-flex;align-items:center;gap:5px;max-width:100%;padding:0 8px;font-size:11px;line-height:1.25;color:#9a9a9a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tie-save-state:empty{display:none}
.tie-save-state::before{content:"";width:6px;height:6px;border-radius:50%;background:#3ddc84;flex-shrink:0}
.tie-save-state[data-level="warn"]{color:#f5c26b}
.tie-save-state[data-level="warn"]::before{background:#f5c26b}
.tie-zoom{display:inline-flex;align-items:center;background:var(--tie-card-2);border-radius:11px;height:38px;padding:0 2px;margin-left:2px}
.tie-zoom-label{min-width:56px;height:34px;border:0;background:transparent;color:#eaeaea;font-family:'JetBrains Mono',monospace;font-size:12px;cursor:pointer;border-radius:8px}
.tie-zoom-label:hover{background:rgba(255,255,255,.06)}
.tie-cmd-btn{display:inline-flex;align-items:center;gap:8px;height:38px;padding:0 10px 0 12px;border-radius:11px;border:0;background:var(--tie-card-2);color:#bdbdbd;font-size:12.5px;font-weight:600;cursor:pointer;font-family:inherit;white-space:nowrap}
.tie-cmd-btn:hover{background:var(--tie-card-3);color:#fff}
.tie-cmd-btn kbd{font-family:'JetBrains Mono',monospace;font-size:10.5px;background:#262626;color:#9a9a9a;border-radius:6px;padding:2px 6px}
.tie-export-btn{display:inline-flex;align-items:center;gap:8px;height:40px;padding:0 16px;border-radius:12px;border:0;background:#f2f2f2;color:#111;font-size:13px;font-weight:700;cursor:pointer;font-family:inherit;white-space:nowrap;box-shadow:0 2px 10px rgba(0,0,0,.22);transition:background .15s,transform .15s}
.tie-export-btn:hover{background:#fff;transform:translateY(-1px)}
.tie-body{flex:1;min-height:0;display:grid;grid-template-columns:auto minmax(0,1fr) min(450px,38vw);gap:10px}
.tie-tools{display:flex;flex-direction:column;align-items:stretch;gap:4px;padding:8px;width:82px;overflow-y:auto;scrollbar-width:none}
.tie-tools::-webkit-scrollbar{display:none}
.tie-tool{display:flex;flex-direction:column;align-items:center;gap:4px;padding:8px 2px 7px;border-radius:12px;border:0;background:transparent;color:#c8c8c8;cursor:pointer;font-family:inherit;transition:background .15s,color .15s}
.tie-tool svg{width:21px;height:21px}
.tie-tool span{font-size:10.5px;font-weight:600;line-height:1.2;text-align:center}
.tie-tool:hover{background:rgba(255,255,255,.07);color:#fff}
.tie-tool[aria-pressed="true"],.tie-tool[aria-expanded="true"]{background:#f2f2f2;color:#111}
.tie-tool:disabled{opacity:.3;cursor:default;background:transparent;color:#c8c8c8}
.tie-tools-gap{height:10px;flex-shrink:0}
.tie-stage{position:relative;min-width:0;min-height:0;border-radius:16px;overflow:hidden;background:#0f0f0f;background-image:radial-gradient(rgba(255,255,255,.045) 1px,transparent 1px);background-size:22px 22px;touch-action:none}
.tie-stage .canvas-container{position:absolute!important;inset:0}
.tie-artboard-bg{position:absolute;left:0;top:0;pointer-events:none;box-shadow:0 10px 40px rgba(0,0,0,.6);transform-origin:0 0}
.tie-artboard-bg.has-fill{background-image:none}
.tie-stage.tool-hand,.tie-stage.tool-hand .upper-canvas{cursor:grab!important}
.tie-stage.is-panning,.tie-stage.is-panning .upper-canvas{cursor:grabbing!important}
.tie-stage.tool-picker .upper-canvas{cursor:crosshair!important}
.tie-stage.tool-crop,.tie-stage.tool-crop .upper-canvas{cursor:crosshair}
.tie-flyout{position:absolute;left:10px;top:10px;z-index:5;display:grid;gap:2px;padding:6px;min-width:190px}
.tie-flyout button{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:10px;border:0;background:transparent;color:#ddd;font-size:13px;cursor:pointer;font-family:inherit;text-align:left}
.tie-flyout button:hover,.tie-flyout button:focus-visible{background:rgba(255,255,255,.08);color:#fff;outline:none}
.tie-flyout svg{width:18px;height:18px;flex-shrink:0}
.tie-stage-isolate{position:absolute;top:12px;left:50%;transform:translateX(-50%);z-index:6;display:inline-flex;align-items:center;gap:10px;padding:6px 7px 6px 13px;border-radius:999px;background:rgba(20,20,20,.92);backdrop-filter:blur(10px);box-shadow:0 12px 32px rgba(0,0,0,.5),inset 0 0 0 1px rgba(255,255,255,.14);max-width:calc(100% - 24px)}
.tie-stage-isolate .tie-pill-btn{min-height:30px;padding:5px 11px;font-size:12px}
.tie-isolate-dot{width:8px;height:8px;border-radius:50%;background:#ffffff;box-shadow:0 0 0 3px rgba(255,255,255,.2);flex-shrink:0}
.tie-stage-isolate-text{font-size:12.5px;font-weight:600;color:#f2f2f2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tie-crop-bar{position:absolute;left:50%;bottom:16px;transform:translateX(-50%);z-index:5;display:flex;align-items:center;gap:10px;padding:8px 10px;max-width:calc(100% - 24px);flex-wrap:wrap;justify-content:center}
.tie-crop-iso-btn{background:#262626;color:#d4d4d4}
.tie-crop-iso-btn:hover{background:#323232;color:#ffffff}
.tie-crop-iso-btn[aria-pressed="true"]{background:#f2f2f2;color:#111111;box-shadow:0 2px 8px rgba(0,0,0,.3)}
.tie-crop-iso-btn[aria-pressed="true"]:hover{background:#ffffff;color:#111111}
.tie-status{position:absolute;left:12px;bottom:12px;z-index:4;display:flex;gap:12px;padding:6px 12px;font-family:'JetBrains Mono',monospace;font-size:11px;color:#9a9a9a;border-radius:10px;pointer-events:none}
.tie-status span:empty{display:none}
.tie-coach{position:absolute;right:14px;bottom:14px;z-index:6;width:min(320px,calc(100% - 28px));padding:16px 16px 12px}
.tie-coach-title{margin:0 0 6px;font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:#a3a3a3;font-weight:600}
.tie-coach-text{margin:0 0 12px;font-size:13.5px;line-height:1.6;color:#eee}
.tie-coach-actions{display:flex;align-items:center;gap:8px;justify-content:flex-end}
.tie-coach-step{margin-right:auto;font-family:'JetBrains Mono',monospace;font-size:11px;color:#777}
.tie-busy{position:absolute;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.52);backdrop-filter:blur(7px)}
.tie-light-dialog,.tie-light-card{background:#ffffff;color:#202024;border-radius:24px;box-shadow:0 24px 64px rgba(0,0,0,.38),0 0 0 1px rgba(17,17,20,.08);color-scheme:light}
.tie-busy-card{display:flex;flex-direction:column;align-items:stretch;gap:14px;padding:24px 26px;width:min(440px,calc(100% - 32px));text-align:left}
.tie-busy-head{display:flex;align-items:center;gap:13px}
.tie-busy-titles{flex:1;min-width:0}
.tie-busy-title{margin:0;font-size:16px;font-weight:700;line-height:1.3;color:#111111}
.tie-busy-sub{margin:3px 0 0;font-size:12.5px;line-height:1.45;color:#5a5a5a}
.tie-busy-pct{font-family:'JetBrains Mono',monospace;font-variant-numeric:tabular-nums;font-size:13.5px;font-weight:700;padding:5px 10px;border-radius:999px;background:#f2f2f2;color:#111111;flex-shrink:0}
.tie-spinner-dark{border-color:rgba(17,17,17,.16);border-top-color:#111111}
.tie-progress{width:100%;height:9px;border-radius:999px;background:#e6e6e6;overflow:hidden}
.tie-progress span{display:block;height:100%;width:0;border-radius:999px;background:linear-gradient(90deg,#7a7a7a 0%,#303030 55%,#0a0a0a 100%);transition:width .22s cubic-bezier(.22,1,.36,1)}
.tie-busy-hint{margin:0;padding:10px 13px;border-radius:12px;background:#f5f5f5;font-size:12px;line-height:1.5;color:#585858}
.tie-busy-foot{display:flex;justify-content:flex-end}
.tie-dropmask{position:absolute;inset:10px;z-index:15;display:flex;align-items:center;justify-content:center;border-radius:14px;background:rgba(10,10,10,.75);box-shadow:inset 0 0 0 2px rgba(255,255,255,.45);font-size:15px;font-weight:600;color:#fff;pointer-events:none}

/* Unified Right Component Area (Properties + Layers/History) */
.tie-side{display:flex;flex-direction:column;gap:10px;min-height:0;background:#121212;border-radius:18px;padding:10px;box-shadow:var(--tie-ring)}
.tie-side .tie-panel{background:#181818;border-radius:14px;box-shadow:none}
.tie-props{flex:1 1 56%;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.tie-panel-title{margin:0;padding:14px 16px 6px;font-size:12px;letter-spacing:.12em;text-transform:uppercase;color:#a3a3a3;font-weight:600}
.tie-props-body{flex:1;overflow-y:auto;padding:6px 12px 14px}
.tie-layers{flex:1 1 44%;min-height:196px;display:flex;flex-direction:column;overflow:hidden}
.tie-tabs{display:flex;gap:6px;padding:8px 8px 4px}
.tie-tabs button{flex:1;height:34px;border-radius:10px;border:0;background:transparent;color:#9a9a9a;font-size:12.5px;font-weight:600;cursor:pointer;font-family:inherit;transition:background .15s,color .15s}
.tie-tabs button[aria-selected="true"]{background:#2a2a2a;color:#fff}
.tie-isolate-bar{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:2px 8px 4px;padding:7px 8px 7px 11px;border-radius:11px;background:#262626;box-shadow:inset 0 0 0 1px rgba(255,255,255,.12)}
.tie-isolate-info{display:inline-flex;align-items:center;gap:8px;font-size:12px;font-weight:600;color:#f0f0f0;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tie-isolate-exit-btn{display:inline-flex;align-items:center;gap:5px;height:28px;padding:0 11px;border-radius:8px;border:0;background:#f2f2f2;color:#111111;font-size:11.5px;font-weight:700;cursor:pointer;font-family:inherit;flex-shrink:0;transition:background .15s,transform .15s}
.tie-isolate-exit-btn:hover{background:#ffffff;transform:translateY(-1px)}
.tie-layer-list,.tie-history-list{flex:1;overflow-y:auto;margin:0;padding:4px 8px;list-style:none;display:flex;flex-direction:column;gap:5px}
.tie-layer-list:focus-visible{outline:2px solid rgba(255,255,255,.5);outline-offset:-2px;border-radius:10px}
.tie-layer{display:flex;align-items:center;gap:8px;padding:6px 6px 6px 8px;border-radius:12px;background:#222222;cursor:pointer;user-select:none;transition:background .12s}
.tie-layer:hover{background:#2b2b2b}
.tie-layer[aria-selected="true"]{background:#2f2f2f;box-shadow:inset 0 0 0 1.5px rgba(255,255,255,.55)}
.tie-layer.is-hidden .tie-layer-thumb,.tie-layer.is-hidden .tie-layer-name{opacity:.38}
.tie-layer.is-drag-over-top{box-shadow:inset 0 2px 0 #f2f2f2}
.tie-layer.is-drag-over-bottom{box-shadow:inset 0 -2px 0 #f2f2f2}
.tie-layer-thumb{width:38px;height:30px;border-radius:7px;flex-shrink:0;object-fit:contain;background-color:#fff;background-image:linear-gradient(45deg,#d9d9d9 25%,transparent 25%),linear-gradient(-45deg,#d9d9d9 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#d9d9d9 75%),linear-gradient(-45deg,transparent 75%,#d9d9d9 75%);background-size:8px 8px;background-position:0 0,0 4px,4px -4px,-4px 0}
.tie-layer-main{flex:1;min-width:0;display:flex;flex-direction:column}
.tie-layer-name-row{display:flex;align-items:center;gap:6px;min-width:0}
.tie-layer-name{font-size:12.5px;font-weight:600;color:#eee;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.tie-layer-solo{display:inline-flex;align-items:center;padding:1px 6px;border-radius:999px;background:#f2f2f2;color:#111111;font-size:10px;font-weight:700;flex-shrink:0}
.tie-layer-meta{font-size:10.5px;color:#858585;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tie-layer-rename{flex:1;min-width:0;width:100%;height:24px;padding:2px 6px;border-radius:6px;border:0;background:#0c0c0c;color:#fff;font-size:12.5px;font-family:inherit;box-shadow:inset 0 0 0 1px rgba(255,255,255,.4)}
.tie-layer .tie-icon-btn{width:28px;height:28px;border-radius:8px;color:#9a9a9a}
.tie-layer .tie-icon-btn[aria-pressed="true"]{background:transparent;color:#f2f2f2}
.tie-layer .tie-icon-btn.is-off{color:#555}
.tie-layer-more{opacity:.65;transition:opacity .15s,background .15s,color .15s}
.tie-layer:hover .tie-layer-more,.tie-layer[aria-selected="true"] .tie-layer-more,.tie-layer-more:focus-visible{opacity:1}
.tie-layer-menu{position:fixed;z-index:10020;min-width:228px;max-width:280px;max-height:min(76vh,540px);overflow-y:auto;padding:6px;border-radius:15px;background:#1a1a1a;box-shadow:0 22px 54px rgba(0,0,0,.65),inset 0 0 0 1px rgba(255,255,255,.12);display:flex;flex-direction:column;gap:5px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.18) transparent}
.tie-layer-menu::-webkit-scrollbar{width:5px}
.tie-layer-menu::-webkit-scrollbar-thumb{background:rgba(255,255,255,.18);border-radius:999px}
.tie-menu-group{display:flex;flex-direction:column;gap:2px;padding:3px;border-radius:11px;background:#222222}
.tie-menu-item{display:flex;align-items:center;gap:9px;width:100%;min-height:34px;padding:6px 10px;border-radius:8px;border:0;background:transparent;color:#eaeaea;font-size:12.5px;font-weight:600;cursor:pointer;font-family:inherit;text-align:left;transition:background .12s,color .12s}
.tie-menu-item:hover,.tie-menu-item:focus-visible{background:#323232;color:#ffffff;outline:none}
.tie-menu-item.is-primary{background:#f2f2f2;color:#111111}
.tie-menu-item.is-primary:hover,.tie-menu-item.is-primary:focus-visible{background:#ffffff;color:#111111}
.tie-menu-item.is-danger:hover,.tie-menu-item.is-danger:focus-visible{background:rgba(255,110,110,.16);color:#ffb4b4}
.tie-menu-item:disabled{opacity:.36;cursor:default;background:transparent;color:#9a9a9a}
.tie-menu-item svg{width:15px;height:15px;flex-shrink:0}
.tie-menu-item span{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tie-menu-item kbd{font-family:'JetBrains Mono',monospace;font-size:10px;color:#8e8e8e;background:#181818;padding:2px 5px;border-radius:5px;flex-shrink:0}
.tie-menu-item.is-primary kbd{background:rgba(0,0,0,.1);color:#333333}
.tie-history-list li{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:10px;background:#222222;font-size:12.5px;color:#ddd;cursor:pointer}
.tie-history-list li:hover{background:#2b2b2b}
.tie-history-list li.is-current{box-shadow:inset 0 0 0 1.5px rgba(255,255,255,.55);color:#fff}
.tie-history-list li.is-future{opacity:.42}
.tie-history-list li span{font-family:'JetBrains Mono',monospace;font-size:10.5px;color:#7e7e7e}
.tie-layer-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;padding:8px 10px 10px}
.tie-layer-act{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:34px;padding:5px 6px;border-radius:10px;border:0;background:#262626;color:#e4e4e4;font-size:11.5px;font-weight:600;cursor:pointer;font-family:inherit;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:background .15s,color .15s}
.tie-layer-act:hover{background:#323232;color:#fff}
.tie-layer-act svg{flex-shrink:0}
.tie-mobile-tabs{display:none}

/* Properties panel blocks & interactive monochrome sliders */
.tie-pblock{background:#222222;border-radius:13px;padding:12px 14px;margin-bottom:10px}
.tie-pblock-title{margin:0 0 10px;font-size:11.5px;font-weight:600;color:#bdbdbd;display:flex;align-items:center;justify-content:space-between;gap:8px}
.tie-reset-btn{display:inline-flex;align-items:center;gap:4px;padding:4px 8px;border-radius:8px;font-size:11px;font-weight:600;color:#d6d6d6;background:rgba(255,255,255,.07);border:0;cursor:pointer;font-family:inherit;transition:background .15s,color .15s}
.tie-reset-btn:hover{background:rgba(255,255,255,.14);color:#fff}
.tie-prow{display:flex;align-items:center;gap:8px;margin-bottom:9px}
.tie-prow:last-child{margin-bottom:0}
.tie-prow>label{font-size:11.5px;color:#b5b5b5;min-width:86px;flex-shrink:0}
.tie-prow .tie-prop-input{min-height:32px;padding:5px 8px;font-size:12px}
.tie-prop-select{min-height:34px;padding:6px 10px;font-size:12.5px}
.tie-range-box{flex:1;min-width:0;height:26px;display:flex;align-items:center;position:relative}
.tie-range-box.is-bipolar::after{content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:2px;height:12px;border-radius:2px;background:rgba(255,255,255,.28);pointer-events:none;z-index:0}
.tie-range-box input[type=range]{-webkit-appearance:none;appearance:none;position:relative;z-index:1;width:100%;height:26px;margin:0;background:transparent;cursor:grab}
.tie-range-box.is-dragging input[type=range]{cursor:grabbing}
.tie-range-box input[type=range]:focus{outline:none}
.tie-range-box input[type=range]::-webkit-slider-runnable-track{height:8px;border-radius:999px;background-color:#111111;background-image:linear-gradient(90deg,transparent var(--fill-start,0%),#a3a3a3 var(--fill-start,0%),#f5f5f5 calc(var(--fill-start,0%) + var(--fill-span,0%)),transparent calc(var(--fill-start,0%) + var(--fill-span,0%)));box-shadow:inset 0 0 0 1px rgba(255,255,255,.09)}
.tie-range-box input[type=range]::-moz-range-track{height:8px;border-radius:999px;background-color:#111111;background-image:linear-gradient(90deg,transparent var(--fill-start,0%),#a3a3a3 var(--fill-start,0%),#f5f5f5 calc(var(--fill-start,0%) + var(--fill-span,0%)),transparent calc(var(--fill-start,0%) + var(--fill-span,0%)));box-shadow:inset 0 0 0 1px rgba(255,255,255,.09)}
.tie-range-box input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:18px;height:18px;margin-top:-5px;border-radius:50%;background:#ffffff;border:2px solid #18181b;box-shadow:0 2px 8px rgba(0,0,0,.55),0 0 0 1px rgba(255,255,255,.7);transition:transform .22s cubic-bezier(.34,1.56,.64,1),box-shadow .2s ease,border-color .15s}
.tie-range-box input[type=range]::-moz-range-thumb{width:18px;height:18px;border-radius:50%;background:#ffffff;border:2px solid #18181b;box-shadow:0 2px 8px rgba(0,0,0,.55),0 0 0 1px rgba(255,255,255,.7);transition:transform .22s cubic-bezier(.34,1.56,.64,1),box-shadow .2s ease,border-color .15s}
.tie-range-box:hover input[type=range]::-webkit-slider-thumb{transform:scale(1.12);box-shadow:0 2px 10px rgba(0,0,0,.6),0 0 0 4px rgba(255,255,255,.15)}
.tie-range-box:hover input[type=range]::-moz-range-thumb{transform:scale(1.12);box-shadow:0 2px 10px rgba(0,0,0,.6),0 0 0 4px rgba(255,255,255,.15)}
.tie-range-box.is-dragging input[type=range]::-webkit-slider-thumb{transform:scale(1.26);border-color:#09090b;box-shadow:0 4px 14px rgba(0,0,0,.65),0 0 0 7px rgba(255,255,255,.24)}
.tie-range-box.is-dragging input[type=range]::-moz-range-thumb{transform:scale(1.26);border-color:#09090b;box-shadow:0 4px 14px rgba(0,0,0,.65),0 0 0 7px rgba(255,255,255,.24)}
.tie-prow output,#tie-quality-out{display:inline-flex;align-items:center;justify-content:center;font-family:'JetBrains Mono',monospace;font-size:11px;color:#cfcfcf;min-width:44px;padding:2px 6px;border-radius:7px;transition:background .15s,color .15s,transform .2s cubic-bezier(.34,1.56,.64,1)}
.tie-prow output.is-dragging,#tie-quality-out.is-dragging{background:#f4f4f5;color:#111111;font-weight:700;transform:translateY(-1px) scale(1.06);box-shadow:0 4px 12px rgba(0,0,0,.4)}
.tie-pgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.tie-pgrid-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.tie-pgrid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.tie-pbtn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:36px;padding:6px 9px;border-radius:10px;border:0;background:#2b2b2b;color:#e4e4e4;font-size:12px;font-weight:600;cursor:pointer;font-family:inherit;transition:background .15s,color .15s;min-width:0;white-space:nowrap}
.tie-pbtn:hover{background:#363636;color:#fff}
.tie-pbtn[aria-pressed="true"]{background:#f2f2f2;color:#111}
.tie-pbtn svg{width:16px;height:16px;flex-shrink:0}
.tie-pbtn-wide{width:100%}
.tie-pbtn-primary{background:#f2f2f2;color:#111}
.tie-pbtn-primary:hover{background:#fff;color:#111}
.tie-pnote{font-size:11.5px;line-height:1.6;color:#8e8e8e;margin:6px 0 0}
.tie-xy{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 10px}
.tie-xy label{display:grid;grid-template-columns:14px minmax(0,1fr);align-items:center;gap:6px;font-size:11.5px;font-weight:600;color:#8f8f8f;font-family:'JetBrains Mono',monospace}
.tie-xy label>span{text-align:center;line-height:1}
.tie-xy input{min-width:0;width:100%;font-variant-numeric:tabular-nums}
.tie-style-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.tie-style{height:44px;border-radius:10px;border:0;background:#2b2b2b;cursor:pointer;font-weight:800;font-size:14px;color:#fff;overflow:hidden;font-family:inherit}
.tie-style:hover{outline:1.5px solid rgba(255,255,255,.55)}
.tie-swatches{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.tie-swatch{width:22px;height:22px;border-radius:50%;border:0;cursor:pointer;box-shadow:inset 0 0 0 1px rgba(255,255,255,.25)}
.tie-swatch:hover{transform:scale(1.12)}
.tie-blend-desc{font-size:11.5px;line-height:1.55;color:#8e8e8e;margin:6px 0 0}

/* Dialogs */
.tie-dialog{border:0;padding:0;margin:auto;border-radius:20px;background:var(--tie-card);color:var(--tie-text);box-shadow:0 30px 80px rgba(0,0,0,.6),var(--tie-ring);width:min(560px,calc(100vw - 24px));max-height:calc(100vh - 32px)}
.tie-dialog::backdrop{background:rgba(0,0,0,.6);backdrop-filter:blur(3px)}
.tie-dialog.tie-light-dialog{background:#ffffff;color:#202024;border-radius:24px;box-shadow:0 24px 64px rgba(0,0,0,.38),0 0 0 1px rgba(17,17,20,.08)}
.tie-dialog.tie-light-dialog::backdrop{background:rgba(0,0,0,.58);backdrop-filter:blur(7px)}
.tie-dialog[open]{animation:tie-pop .18s ease-out}
@keyframes tie-pop{from{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}
.tie-dialog-inner{display:block;padding:20px 22px 22px;margin:0}
.tie-light-dialog .tie-dialog-inner{padding:26px 26px 24px}
.tie-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:6px}
.tie-dialog h2{margin:0;font-size:17px;font-weight:700}
.tie-light-dialog h2{font-size:18.5px;color:#151518;letter-spacing:-.01em}
.tie-wmodal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:14px}
.tie-wmodal-head-left{display:flex;align-items:center;gap:14px;min-width:0}
.tie-wmodal-badge{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:14px;background:#f3f3f3;color:#111111;flex-shrink:0}
.tie-wmodal-eyebrow{margin:0 0 3px;font-size:10.5px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:#686868}
.tie-wmodal-close{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:999px;border:0;background:#f2f2f2;color:#4a4a4a;cursor:pointer;flex-shrink:0;transition:background .15s,color .15s}
.tie-wmodal-close:hover{background:#e5e5e5;color:#111111}
.tie-wmodal-desc{margin:0;font-size:13.5px;line-height:1.68;color:#4d4d4d}
.tie-wmodal-highlights{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:16px}
.tie-wmodal-card{display:flex;align-items:flex-start;gap:10px;padding:12px 13px;border-radius:14px;background:#f5f5f5}
.tie-wmodal-card-ico{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:9px;background:#ffffff;color:#111111;box-shadow:0 1px 3px rgba(0,0,0,.07);flex-shrink:0}
.tie-wmodal-card strong{display:block;font-size:12.5px;font-weight:700;color:#111111;line-height:1.35}
.tie-wmodal-card span{display:block;margin-top:2px;font-size:11.5px;line-height:1.45;color:#666666}
.tie-wmodal-oss{margin:14px 0 0;font-size:11.5px;color:#787878}
.tie-wmodal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}
.tie-wbtn{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:40px;padding:0 18px;border-radius:999px;border:0;font-size:13px;font-weight:700;cursor:pointer;font-family:inherit;transition:background .15s,transform .15s}
.tie-wbtn-ghost{background:#f2f2f2;color:#333333}
.tie-wbtn-ghost:hover{background:#e5e5e5;color:#111111}
.tie-wbtn-primary{background:#18181b;color:#ffffff}
.tie-wbtn-primary:hover{background:#000000;transform:translateY(-1px)}
.tie-dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}
.tie-export-dialog{width:min(680px,calc(100vw - 24px))}
.tie-format-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.tie-format{position:relative;display:flex;flex-direction:column;gap:3px;padding:12px;border-radius:14px;background:var(--tie-card-2);cursor:pointer;transition:background .15s,box-shadow .15s}
.tie-format:hover{background:var(--tie-card-3)}
.tie-format input{position:absolute;opacity:0;inset:0;margin:0;cursor:pointer}
.tie-format strong{font-size:14px;color:#fff}
.tie-format small{font-size:11px;color:#8d8d8d;line-height:1.4}
.tie-format:has(input:checked){box-shadow:inset 0 0 0 2px #f2f2f2;background:#232323}
.tie-format:has(input:focus-visible){outline:2px solid #fff;outline-offset:2px}
.tie-format.is-disabled{opacity:.4;cursor:not-allowed}
.tie-format.is-disabled input{cursor:not-allowed}
.tie-export-opts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 18px;margin-top:4px}
.tie-export-opts .tie-check,.tie-field-wide{grid-column:1/-1}
.tie-export-opts .tie-check{margin-top:14px}
.tie-field-wide{margin-top:12px}
.tie-export-foot{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-top:18px;padding:14px;border-radius:14px;background:var(--tie-card-2)}
.tie-export-info p{margin:0;font-size:12.5px;line-height:1.6}
.tie-export-info #tie-export-dims{font-family:'JetBrains Mono',monospace;color:#fff}
.tie-export-note{color:#8a8a8a;font-size:11.5px!important;max-width:380px}
.tie-cmd-dialog{width:min(560px,calc(100vw - 24px));margin:10vh auto auto}
.tie-cmd-dialog .tie-dialog-inner{padding:10px}
.tie-cmd-search{display:flex;align-items:center;gap:10px;padding:4px 12px;border-radius:14px;background:var(--tie-card-2);color:#9a9a9a}
.tie-cmd-search input{flex:1;height:46px;border:0;background:transparent;color:#fff;font-size:15px;font-family:inherit}
.tie-cmd-search input:focus{outline:none}
.tie-cmd-list{list-style:none;margin:8px 0 0;padding:0;max-height:min(52vh,420px);overflow-y:auto;display:grid;gap:2px}
.tie-cmd-list li{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border-radius:10px;font-size:13.5px;color:#ddd;cursor:pointer}
.tie-cmd-list li[aria-selected="true"]{background:#2a2a2a;color:#fff}
.tie-cmd-list kbd{font-family:'JetBrains Mono',monospace;font-size:10.5px;color:#8a8a8a}
.tie-cmd-empty{padding:12px;margin:0}
.tie-keys-modal{width:min(820px,calc(100vw - 24px))}
.tie-keys-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:8px;max-height:58vh;overflow-y:auto;padding-right:4px;scrollbar-width:thin;scrollbar-color:rgba(0,0,0,.18) transparent}
.tie-keys-grid::-webkit-scrollbar{width:6px}
.tie-keys-grid::-webkit-scrollbar-thumb{background:rgba(0,0,0,.18);border-radius:999px}
.tie-key-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 12px;border-radius:12px;background:#f5f5f5}
.tie-key-action{font-size:12.5px;font-weight:600;color:#1a1a1a;line-height:1.35;white-space:nowrap}
.tie-key-combo{display:inline-flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:2px;flex-shrink:0}
.tie-key-combo kbd{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;padding:0 6px;border-radius:6px;background:#ffffff;color:#111111;font-family:'JetBrains Mono',monospace;font-size:10.5px;font-weight:600;box-shadow:0 1px 0 1px rgba(0,0,0,.11),0 1px 2px rgba(0,0,0,.05)}
.tie-key-sep{font-size:11px;color:#737373;padding:0 1px}
.tie-toast{position:fixed;left:50%;bottom:24px;transform:translate(-50%,20px);z-index:10050;max-width:min(520px,calc(100vw - 32px));padding:12px 18px;border-radius:12px;background:#f2f2f2;color:#111;font-size:13px;font-weight:600;box-shadow:0 12px 40px rgba(0,0,0,.4);opacity:0;pointer-events:none;transition:opacity .2s,transform .2s}
body:has(#tie-crop-bar:not([hidden])) .tie-toast{top:86px;bottom:auto!important}
html.tie-app-mode .tk-toast-container{bottom:86px!important}
.tie-toast.is-on{opacity:1;transform:translate(-50%,0)}
.tie-toast[data-type="error"]{background:#ff8d8d}

/* Narrow screens: bottom tab bar + sheets */
@media (max-width:1023px){
    .tie-editor{padding:6px;gap:6px}
    .tie-top{min-height:50px;padding:5px 8px;gap:4px}
    .tie-top-group{gap:3px}
    .tie-top-group:first-child{flex:1 1 auto;min-width:0;overflow:hidden}
    .tie-top-mid,.tie-top-end{flex:0 0 auto}
    .tie-top-btn span,.tie-cmd-btn span,.tie-cmd-btn kbd,.tie-save-state,#tie-help,.tie-export-btn{display:none}
    .tie-top .tie-icon-btn,.tie-top-btn,.tie-cmd-btn{width:32px;height:32px;padding:0;justify-content:center;border-radius:10px}
    .tie-zoom{height:32px;margin-left:2px}
    .tie-zoom-label{min-width:44px;height:30px;padding:0 4px}
    .tie-title-stack{flex:1 1 60px;margin-left:2px}
    .tie-name{min-width:0;width:100%;max-width:180px;height:30px;padding:3px 6px;font-size:13px;text-overflow:ellipsis}
    .tie-body{display:block;position:relative;overflow:hidden;border-radius:16px}
    .tie-stage{position:absolute;inset:0}
    .tie-tools,.tie-side{position:absolute;left:0;right:0;bottom:0;z-index:30;max-height:62%;transform:translateY(110%);visibility:hidden;pointer-events:none;transition:transform .25s cubic-bezier(.22,1,.36,1),visibility 0s linear .25s;box-shadow:0 -20px 50px rgba(0,0,0,.55)}
    .tie-tools{width:auto;flex-direction:row;flex-wrap:wrap;justify-content:center;padding:12px;gap:6px;border-radius:18px 18px 16px 16px}
    .tie-tool{width:72px}
    .tie-tools-gap{display:none}
    .tie-side{display:block;background:transparent;padding:0;box-shadow:none;overflow:visible}
    .tie-side .tie-panel{max-height:62vh;border-radius:18px 18px 16px 16px;background:var(--tie-card)}
    .tie-editor[data-sheet="tools"] .tie-tools{transform:none;visibility:visible;pointer-events:auto;transition:transform .25s cubic-bezier(.22,1,.36,1),visibility 0s}
    .tie-editor[data-sheet="props"] .tie-side,.tie-editor[data-sheet="layers"] .tie-side{transform:none;visibility:visible;pointer-events:auto;transition:transform .25s cubic-bezier(.22,1,.36,1),visibility 0s}
    .tie-editor[data-sheet="props"] .tie-layers,.tie-editor[data-sheet="layers"] .tie-props{display:none}
    .tie-editor[data-sheet="props"] .tie-props{display:flex;height:min(62vh,520px)}
    .tie-editor[data-sheet="layers"] .tie-layers{height:min(56vh,460px)}
    .tie-mobile-tabs{position:relative;z-index:40;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;padding:4px;background:var(--tie-card);border-radius:16px;box-shadow:var(--tie-ring);padding-bottom:max(4px,env(safe-area-inset-bottom))}
    .tie-mobile-tabs button{display:flex;flex-direction:column;align-items:center;gap:2px;min-height:48px;padding:6px 2px;border-radius:12px;border:0;background:transparent;color:#bdbdbd;font-size:11px;font-weight:600;cursor:pointer;font-family:inherit}
    .tie-mobile-tabs button[aria-pressed="true"]{background:#f2f2f2;color:#111}
    .tie-status{display:none}
    .tie-coach{left:10px;right:10px;width:auto;bottom:70px}
    .tie-format-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
    .tie-export-opts{grid-template-columns:1fr}
    .tie-export-foot{flex-direction:column;align-items:stretch}
    .tie-dialog{max-height:calc(100dvh - 20px);overflow-y:auto}
    .tie-toast{bottom:calc(74px + env(safe-area-inset-bottom))}
    body:has(#tie-crop-bar:not([hidden])) .tie-toast{top:68px;bottom:auto!important}
}
@media (max-width:640px){
    .tie-keys-grid,.tie-wmodal-highlights{grid-template-columns:1fr}
    .tie-layer-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (prefers-reduced-motion:reduce){.tie-page *{animation-duration:.01ms!important;transition-duration:.01ms!important}}

/* Warm Paper ("暖雾纸砚") Light Mode for Landing, Picker (#tie-picker), Studio (#tie-editor / #edit), Menus & Dialogs */
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page{
  --tie-bg:var(--tk-bg);--tie-card:var(--tk-surface);--tie-card-2:#ebe6da;--tie-card-3:#e1dacb;
  --tie-text:var(--tk-ink);--tie-muted:var(--tk-muted);--tie-faint:var(--tk-subtle);--tie-accent:var(--tk-ink);
  --tie-ring:0 0 0 1px var(--tk-border),0 4px 16px rgba(40,35,26,.04);
}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page :is(.tie-picker,.tie-editor,.tie-dialog,.tie-layer-menu){
  color:var(--tk-ink);color-scheme:light;
}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page :is(.tie-picker-body,.tie-preset-groups,.tie-picker-side,.tie-props-body,.tie-layer-list,.tie-history-list,.tie-cmd-list,.tie-dialog,.tie-layer-menu){
  scrollbar-width:thin;scrollbar-color:rgba(56,52,45,.22) transparent;
}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page :is(.tie-picker-body,.tie-preset-groups,.tie-picker-side,.tie-props-body,.tie-layer-list,.tie-history-list,.tie-cmd-list,.tie-dialog,.tie-layer-menu)::-webkit-scrollbar-thumb{
  background:rgba(56,52,45,.22);border-radius:999px;border:1.5px solid transparent;background-clip:padding-box;
}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page :is(.tie-picker-body,.tie-preset-groups,.tie-picker-side,.tie-props-body,.tie-layer-list,.tie-history-list,.tie-cmd-list,.tie-dialog,.tie-layer-menu)::-webkit-scrollbar-thumb:hover{
  background:rgba(56,52,45,.38);
}

/* Landing page */
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-start :is(.tie-h2,.tie-card-create h2,.tie-card-open h2,.tie-resume-text h3),
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page :is(.tie-section,.tie-related) :is(.tie-h2,.tie-feature h3,.tie-step h3,.tie-mini h3,.tie-faq-item summary){color:var(--tk-ink)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page :is(.tie-eyebrow,.tie-muted,.tie-quick-dims,.tie-boundary,.tie-faq-a p,.tie-link-btn){color:var(--tk-muted)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-link-btn:hover,
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-tip-list .tie-mini,
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-loading{color:var(--tk-ink-secondary)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-quick-btn{background:var(--tk-raised);border:1px solid var(--tk-border);color:var(--tk-ink);box-shadow:0 1px 2px rgba(40,35,26,.04)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-quick-btn:hover{background:var(--tk-surface-2);border-color:var(--tk-border-strong)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-quick-shape::before{background:rgba(31,29,26,.08);box-shadow:inset 0 0 0 1.5px rgba(31,29,26,.45)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-drop{background:var(--tk-raised);border:1.5px dashed var(--tk-border-strong)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-drop:hover,
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-drop.is-dragover{background:var(--tk-surface);box-shadow:0 0 0 2px var(--tk-accent-mark)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page :is(.tie-drop-icon,.tie-feature-icon,.tie-resume-thumb){background:var(--tk-surface-2);color:var(--tk-ink-secondary)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-step-no{background:linear-gradient(180deg,var(--tk-btn-top) 0%,var(--tk-btn-bot) 100%);border:1px solid var(--tk-btn-border);color:var(--tk-ink)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-mini{background:var(--tk-raised);border:1px solid var(--tk-border)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-spinner:not(.tie-spinner-dark){border-color:var(--tk-border);border-top-color:var(--tk-ink)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-toast:not([data-type="error"]){background:#2b2722;color:#f6f4ee}

/* Shared Studio Controls */
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-icon-btn{color:#49443b}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-icon-btn:hover:not(:disabled){background:rgba(30,28,25,.07);color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-icon-btn[aria-pressed="true"]{background:linear-gradient(180deg,#e6decb 0%,#dad0ba 100%);color:#1e1c19;box-shadow:inset 0 0 0 1px #bcb097}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-pill-btn{background:#ebe6da;border:1px solid #d7cfc0;color:#2b2722}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-pill-btn:hover{background:#e2dac9;border-color:#bfb5a1;color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-pill-primary{background:linear-gradient(180deg,#e6decb 0%,#dad0ba 100%);border:1px solid #bcb097;color:#1e1c19;box-shadow:inset 0 1px 0 rgba(255,253,248,.75)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-pill-primary:hover{background:linear-gradient(180deg,#ddd4be 0%,#cfc3a8 100%);border-color:#a6987c}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page :is(.tie-ratio-chip,.tie-radio span){background:#ebe6da;border:1px solid #dad2c2;color:#38342d}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page :is(.tie-ratio-chip:hover,.tie-radio span:hover){background:#e2dac9;color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page :is(.tie-ratio-chip[aria-pressed="true"],.tie-radio input:checked+span){background:linear-gradient(180deg,#e6decb 0%,#dad0ba 100%);border-color:#a6987c;color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-radio input:focus-visible+span{outline:2px solid #85765e;outline-offset:2px}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page :is(.tie-field>span,.tie-field-label){color:#49443b}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page :is(.tie-field input,.tie-field select,.tie-prop-input,.tie-prop-select){background:#fbfaf6;color:#1e1c19;box-shadow:inset 0 0 0 1px #d5cdbd}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page :is(.tie-field input:focus,.tie-field select:focus,.tie-prop-input:focus,.tie-prop-select:focus){background:#fffdf9;box-shadow:inset 0 0 0 1.5px #85765e,0 0 0 3px rgba(133,118,94,.16)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-color{background:#fbfaf6;box-shadow:inset 0 0 0 1px #cfc6b4}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page :is(.tie-range,.tie-check input){accent-color:#6e604b}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-check{color:#38342d}

/* Picker (Stage 2) */
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-picker{background:var(--tk-bg)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page :is(.tie-picker-top h2,.tie-custom h3){color:var(--tk-ink)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-preset-group{background:var(--tk-surface);box-shadow:var(--tie-ring)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-preset-group h3{color:#49443b}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-preset{background:var(--tk-raised);border:1px solid var(--tk-border);color:#2b2722;box-shadow:0 1px 2px rgba(40,35,26,.04)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-preset:hover{background:#f1ede3;border-color:#bfb5a1}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-preset[aria-pressed="true"]{background:linear-gradient(180deg,#f3ede0 0%,#e9e0ce 100%);border-color:#85765e;box-shadow:0 0 0 1.5px #85765e,0 4px 12px rgba(40,35,26,.07);color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-preset-shape span{background:rgba(133,118,94,.14);box-shadow:inset 0 0 0 1.5px #786a54}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-preset-dims{color:#595348}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-picker-act{background:#ebe6da;border:1px solid #d5cdbd;color:#2b2722}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-picker-act:hover{background:#e2dac9;border-color:#bfb5a1;color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-picker-act[aria-pressed="true"]{background:linear-gradient(180deg,#e6decb 0%,#dad0ba 100%);border-color:#a6987c;color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-preview-stage{background:#e5e0d4;border:1px solid #d5cdbd}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-preview-box{box-shadow:0 8px 24px rgba(40,35,26,.14)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-preview-px{color:#38342d}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-picker-msg{color:#575248}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-picker-msg[data-level="warn"]{color:#9a4a06}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-picker-msg[data-level="error"]{color:#b91c1c}

/* Editor (Stage 3 / #edit) */
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-editor{background:#e7e2d7}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-top{background:var(--tk-surface);box-shadow:var(--tie-ring)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-top-btn{background:#ebe6da;border:1px solid #dad2c2;color:#2b2722}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-top-btn:hover:not(:disabled){background:#e0d8c6;border-color:#bfb5a1;color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-name{color:var(--tk-ink)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-name:hover{background:rgba(30,28,25,.05)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-name:focus{background:#fbfaf6;box-shadow:inset 0 0 0 1.5px #85765e}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-save-state{color:#575248}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-save-state::before{background:#2f855a}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-save-state[data-level="warn"]{color:#9a4a06}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-save-state[data-level="warn"]::before{background:#9a4a06}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-zoom{background:#ebe6da;border:1px solid #dad2c2}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-zoom-label{color:#2b2722}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-zoom-label:hover{background:rgba(30,28,25,.06);color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-cmd-btn{background:#ebe6da;border:1px solid #dad2c2;color:#49443b}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-cmd-btn:hover{background:#e0d8c6;border-color:#bfb5a1;color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-cmd-btn kbd{background:#fbfaf6;border:1px solid #d5cdbd;color:#575248}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-export-btn{background:linear-gradient(180deg,#e6decb 0%,#dad0ba 100%);border:1px solid #bcb097;color:#1e1c19;box-shadow:inset 0 1px 0 rgba(255,253,248,.82),0 2px 6px rgba(40,35,26,.06)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-export-btn:hover{background:linear-gradient(180deg,#ddd4be 0%,#cfc3a8 100%);border-color:#a6987c}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page #tie-help.tie-shortcuts-btn{background:#fbfaf6;border:1px solid #d5cdbd;color:#2b2722;box-shadow:0 1px 2px rgba(40,35,26,.04)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page #tie-help.tie-shortcuts-btn:hover{background:#efeadd;border-color:#bfb5a1;color:#1e1c19}

/* Tool Rail */
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-tools{background:var(--tk-surface);box-shadow:var(--tie-ring)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-tool{color:#49443b}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-tool:hover:not(:disabled){background:#ebe6da;color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-tool:is([aria-pressed="true"],[aria-expanded="true"]){background:linear-gradient(180deg,#e6decb 0%,#dad0ba 100%);color:#1e1c19;box-shadow:inset 0 0 0 1px #bcb097}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-tool:disabled{color:#8a8273;opacity:.42;background:transparent}

/* Workspace Stage */
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-stage{background-color:#ded8ca;background-image:radial-gradient(rgba(56,52,45,.11) 1px,transparent 1px);box-shadow:inset 0 0 0 1px #cfc7b6}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-artboard-bg{box-shadow:0 10px 34px rgba(40,35,26,.16),0 0 0 1px rgba(40,35,26,.08)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-flyout{background:#fbfaf6;box-shadow:0 14px 36px rgba(40,35,26,.14),0 0 0 1px #d5cdbd}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-flyout button{color:#2b2722}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-flyout button:hover,
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-flyout button:focus-visible{background:#ebe6da;color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-stage-isolate{background:rgba(251,250,246,.95);box-shadow:0 10px 28px rgba(40,35,26,.14),inset 0 0 0 1px #cfc6b4}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-isolate-dot{background:#6e604b;box-shadow:0 0 0 3px rgba(110,96,75,.2)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-stage-isolate-text{color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-crop-bar{background:rgba(251,250,246,.96);box-shadow:0 12px 32px rgba(40,35,26,.14),0 0 0 1px #d5cdbd}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-crop-iso-btn{background:#ebe6da;color:#38342d}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-crop-iso-btn:hover{background:#e0d8c6;color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-crop-iso-btn[aria-pressed="true"]{background:linear-gradient(180deg,#e6decb 0%,#dad0ba 100%);color:#1e1c19;box-shadow:inset 0 0 0 1px #bcb097}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-crop-iso-btn[aria-pressed="true"]:hover{background:linear-gradient(180deg,#ddd4be 0%,#cfc3a8 100%);color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-status{background:rgba(251,250,246,.9);color:#49443b;box-shadow:0 2px 8px rgba(40,35,26,.08),0 0 0 1px #d8d0c0}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-coach{background:#fbfaf6;box-shadow:0 14px 36px rgba(40,35,26,.15),0 0 0 1px #d5cdbd}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-coach-title{color:#6e604b}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-coach-text{color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-coach-step{color:#595348}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-dropmask{background:rgba(246,244,238,.88);box-shadow:inset 0 0 0 2px #85765e;color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-busy{background:rgba(40,35,26,.28)}

/* Right Properties, Layers & History */
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-side{background:#ebe6da;box-shadow:inset 0 0 0 1px #d8d0c0}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-side .tie-panel{background:var(--tk-surface);box-shadow:0 1px 3px rgba(40,35,26,.04),0 0 0 1px #ded7c8}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-panel-title{color:#575248}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-pblock{background:#efeadd;border:1px solid #dfd8c8}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-pblock-title{color:#38342d}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-reset-btn{background:#fbfaf6;border:1px solid #d5cdbd;color:#38342d}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-reset-btn:hover{background:#e5decb;border-color:#bfb5a1;color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-prow>label{color:#49443b}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-range-box.is-bipolar::after{background:rgba(56,52,45,.32)}
html.light-mode:not([data-tk-theme-lock="dark"]) #tie-props .tie-range-box input[type=range]{background:transparent!important;border:0;box-shadow:none}
html.light-mode:not([data-tk-theme-lock="dark"]) #tie-props .tie-range-box input[type=range]:focus-visible{outline:none!important}
html.light-mode #tie-props input[type=range]:focus-visible::-webkit-slider-thumb{outline:2px solid var(--tk-muted);outline-offset:2px}
html.light-mode #tie-props input[type=range]:focus-visible::-moz-range-thumb{outline:2px solid var(--tk-muted);outline-offset:2px}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-range-box input[type=range]::-webkit-slider-runnable-track{background-color:#ded7c7;background-image:linear-gradient(90deg,transparent var(--fill-start,0%),#9a8b72 var(--fill-start,0%),#635540 calc(var(--fill-start,0%) + var(--fill-span,0%)),transparent calc(var(--fill-start,0%) + var(--fill-span,0%)));box-shadow:inset 0 0 0 1px rgba(40,35,26,.12)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-range-box input[type=range]::-moz-range-track{background-color:#ded7c7;background-image:linear-gradient(90deg,transparent var(--fill-start,0%),#9a8b72 var(--fill-start,0%),#635540 calc(var(--fill-start,0%) + var(--fill-span,0%)),transparent calc(var(--fill-start,0%) + var(--fill-span,0%)));box-shadow:inset 0 0 0 1px rgba(40,35,26,.12)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-range-box input[type=range]::-webkit-slider-thumb{background:#fbfaf6;border:2px solid #5c4f3d;box-shadow:0 2px 6px rgba(40,35,26,.22)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-range-box input[type=range]::-moz-range-thumb{background:#fbfaf6;border:2px solid #5c4f3d;box-shadow:0 2px 6px rgba(40,35,26,.22)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-range-box:hover input[type=range]::-webkit-slider-thumb{box-shadow:0 2px 8px rgba(40,35,26,.25),0 0 0 4px rgba(133,118,94,.2)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-range-box.is-dragging input[type=range]::-webkit-slider-thumb{border-color:#3d3427;box-shadow:0 3px 10px rgba(40,35,26,.28),0 0 0 6px rgba(133,118,94,.26)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page :is(.tie-prow output,#tie-quality-out){color:#49443b}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page :is(.tie-prow output.is-dragging,#tie-quality-out.is-dragging){background:#5c4f3d;color:#fbfaf6;box-shadow:0 2px 8px rgba(40,35,26,.22)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-pbtn{background:#fbfaf6;border:1px solid #d7cfc0;color:#2b2722}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-pbtn:hover{background:#e6dfd0;border-color:#bfb5a1;color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page :is(.tie-pbtn[aria-pressed="true"],.tie-pbtn-primary,.tie-pbtn-primary:hover){background:linear-gradient(180deg,#e6decb 0%,#dad0ba 100%);border:1px solid #bcb097;color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-pbtn-primary:hover{background:linear-gradient(180deg,#ddd4be 0%,#cfc3a8 100%);border-color:#a6987c}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page :is(.tie-pnote,.tie-blend-desc,.tie-xy label){color:#575248}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-swatch{box-shadow:inset 0 0 0 1px rgba(30,28,25,.22)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-tabs button{color:#575248}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-tabs button[aria-selected="true"]{background:#ebe6da;color:#1e1c19;box-shadow:inset 0 0 0 1px #d5cdbd}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-isolate-bar{background:#ebe6da;box-shadow:inset 0 0 0 1px #cfc6b4}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-isolate-info{color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-isolate-exit-btn{background:linear-gradient(180deg,#e6decb 0%,#dad0ba 100%);border:1px solid #bcb097;color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-layer{background:#efeadd;border:1px solid #e0d9c9}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-layer:hover{background:#e7e0d0}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-layer[aria-selected="true"]{background:#fbfaf6;border-color:#85765e;box-shadow:0 0 0 1px rgba(133,118,94,.24)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-layer.is-drag-over-top{box-shadow:inset 0 2px 0 #5c4f3d}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-layer.is-drag-over-bottom{box-shadow:inset 0 -2px 0 #5c4f3d}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-layer-name{color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-layer-meta{color:#595348}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-layer-solo{background:#e6decb;border:1px solid #bcb097;color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-layer-rename{background:#fbfaf6;color:#1e1c19;box-shadow:inset 0 0 0 1.5px #85765e}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-layer .tie-icon-btn{color:#575248}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-layer .tie-icon-btn[aria-pressed="true"]{background:transparent;color:#1e1c19;box-shadow:none}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-layer .tie-icon-btn.is-off{color:#a39b8b}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-history-list li{background:#efeadd;border:1px solid #e0d9c9;color:#2b2722}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-history-list li:hover{background:#e7e0d0}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-history-list li.is-current{background:#fbfaf6;box-shadow:inset 0 0 0 1.5px #85765e;color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-history-list li span{color:#595348}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-layer-act{background:#ebe6da;border:1px solid #d5cdbd;color:#2b2722}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-layer-act:hover{background:#dfd7c5;border-color:#bfb5a1;color:#1e1c19}

/* Context Menu & Dialogs */
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-layer-menu{background:#fbfaf6;box-shadow:0 20px 50px rgba(40,35,26,.18),inset 0 0 0 1px #d5cdbd}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-menu-group{background:#f2eee4}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-menu-item{color:#2b2722}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-menu-item:hover,
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-menu-item:focus-visible{background:#e5dfd0;color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-menu-item.is-primary{background:linear-gradient(180deg,#e6decb 0%,#dad0ba 100%);color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-menu-item.is-primary:hover{background:linear-gradient(180deg,#ddd4be 0%,#cfc3a8 100%)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-menu-item.is-danger:hover{background:rgba(185,28,28,.1);color:#b91c1c}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-menu-item:disabled{color:#8a8273}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-menu-item kbd{background:#fbfaf6;border:1px solid #d5cdbd;color:#575248}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-dialog:not(.tie-light-dialog){background:var(--tk-surface);color:var(--tk-ink);box-shadow:0 24px 64px rgba(40,35,26,.2),0 0 0 1px #d5cdbd}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-dialog::backdrop{background:rgba(40,35,26,.34)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-format{background:var(--tk-raised);border:1px solid var(--tk-border)}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-format:hover{background:#f1ede3;border-color:#bfb5a1}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-format strong{color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-format small{color:#575248}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-format:has(input:checked){background:linear-gradient(180deg,#f3ede0 0%,#e9e0ce 100%);border-color:#85765e;box-shadow:inset 0 0 0 1px #85765e}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-export-foot{background:#efeadd;border:1px solid #dfd8c8}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-export-info #tie-export-dims{color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-export-note{color:#575248}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-cmd-search{background:#fbfaf6;border:1px solid #d5cdbd;color:#575248}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-cmd-search input{color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-cmd-list li{color:#2b2722}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-cmd-list li[aria-selected="true"]{background:#ebe6da;color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-cmd-list kbd{color:#575248}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-wbtn-primary{background:linear-gradient(180deg,#e6decb 0%,#dad0ba 100%);border:1px solid #bcb097;color:#1e1c19}
html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-wbtn-primary:hover{background:linear-gradient(180deg,#ddd4be 0%,#cfc3a8 100%)}

/* Mobile Bottom Tabs & Sheets */
@media (max-width:1023px){
  html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-side{background:transparent;box-shadow:none}
  html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-mobile-tabs{background:var(--tk-surface);box-shadow:var(--tie-ring)}
  html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-mobile-tabs button{color:#575248}
  html.light-mode:not([data-tk-theme-lock="dark"]) .tie-page .tie-mobile-tabs button[aria-pressed="true"]{background:linear-gradient(180deg,#e6decb 0%,#dad0ba 100%);color:#1e1c19;box-shadow:inset 0 0 0 1px #bcb097}
}
