/* The resizable library overlays the field without reserving space for it or moving menus. */
body{--may-template-panel-width:50vw}
.mtp-resize{top:var(--may-library-field-top,0px)!important;bottom:auto!important;height:var(--may-library-field-height,100dvh)}
.mtp-resize{position:fixed;top:0;bottom:0;width:10px;margin-right:0;z-index:7;cursor:ew-resize;touch-action:none;user-select:none;background-repeat:repeat-y;background-size:10px 24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='24'%3E%3Cpath d='M9 0L2.07 12L9 24H10V0Z' fill='%230e1116'/%3E%3Cpath d='M9 0L2.07 12L9 24' fill='none' stroke='%23b48cff' stroke-width='1.5'/%3E%3C/svg%3E")}
.mtp-resize[hidden]{display:none!important}
.mtp-resize:hover,.mtp-resize:focus-visible,body.may-template-panel-resizing .mtp-resize{outline:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='24'%3E%3Cpath d='M9 0L2.07 12L9 24H10V0Z' fill='%230e1116'/%3E%3Cpath d='M9 0L2.07 12L9 24' fill='none' stroke='%23d9b9ff' stroke-width='2'/%3E%3C/svg%3E")}
body.may-template-panel-resizing,body.may-template-panel-resizing *{cursor:ew-resize!important;user-select:none!important}
#mayatnikTemplatePanel{--mtp-accent:#b48cff;position:fixed;inset:0 0 0 auto;width:var(--may-template-panel-width);height:100vh;height:100dvh;box-sizing:border-box;overflow:auto;overscroll-behavior:contain;z-index:7;background:#0e1116;color:#dfe6f5;border-left:0;padding:6px;display:flex;flex-direction:column;gap:4px;font:12px/1.35 system-ui,sans-serif;scrollbar-width:thin;user-select:none}
#mayatnikTemplatePanel[hidden]{display:none!important}
/* Right field controls sit beneath the open library, whose layer is 7. */
body.may-template-panel-open:not(.may-mobile-menu) #mayRhombs{z-index:6}
body.may-template-panel-open .may-template-inline{z-index:6}
/* Folds are applied once on opening and removed on closing; persistence stays with menu owners. */
body.mayatnik-menu-ready :is(#paintTools,#mayatnikRail,#mayatnikRailR,#mayMobileBar) :is(.pt-g,.gz-group)[data-library-folded][data-library-folded] > :is(.pt-r,.may-rail-list,.gz-soty,.gz-wide){display:none!important}
body>[data-library-folded-popup]{display:none!important}
/* The legacy right rail also sits above the field overlay, like the other menus. */
.mayatnik-menu-ready :is(#mayatnikRailR,#canvasActs,.may-pin,.may-manual-axis-controls){z-index:8}
#mayatnikTemplatePanel *{box-sizing:border-box}
:is(#mayatnikTemplatePanel,#mayBackupDialog,#mayGifDialog,#mayAxis512PaletteDialog) button,#mayatnikTemplatePanel summary{font:inherit;color:inherit;text-shadow:none!important;cursor:pointer;user-select:none;-webkit-user-select:none}
#mayatnikTemplatePanel .mtp-heading{display:flex;align-items:center;gap:2px;flex:none;min-height:26px}
#mayatnikTemplatePanel .mtp-heading strong{flex:1;font-size:14px;min-width:0}
#mayatnikTemplatePanel .mtp-header-path{display:flex;align-items:center;gap:2px;flex:1;min-width:0;overflow:hidden;white-space:nowrap;font-size:12px}
#mayatnikTemplatePanel .mtp-header-crumb{flex:0 1 auto;min-width:0;height:24px;padding:0;border:0;background:transparent;color:inherit;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#mayatnikTemplatePanel .mtp-header-path>span{flex:none}
#mayatnikTemplatePanel .mtp-header-crumb:focus-visible{outline:1px solid var(--mtp-accent);outline-offset:-1px}
:is(#mayatnikTemplatePanel,#mayBackupDialog,#mayGifDialog,#mayAxis512PaletteDialog) .mtp-command,#mayatnikTemplatePanel .mtp-path,#mayatnikTemplatePanel .mtp-more>summary{--gz-w:120px;--gz-h:24px;position:relative;display:flex;align-items:center;justify-content:center;flex:none;width:120px;height:24px;margin:0;padding:0 10px;border:0;border-radius:0;background:#1b2430;clip-path:polygon(10px 0,calc(100% - 10px) 0,100% 50%,calc(100% - 10px) 100%,10px 100%,0 50%);box-shadow:none!important;outline:none;line-height:24px}
:is(#mayatnikTemplatePanel,#mayBackupDialog,#mayGifDialog,#mayAxis512PaletteDialog) .mtp-command::after,#mayatnikTemplatePanel .mtp-path::after,#mayatnikTemplatePanel summary::after{content:"";pointer-events:none;position:absolute;inset:0;background:var(--mtp-accent);clip-path:polygon(10px 0,11px 1px,2px 50%,11px calc(100% - 1px),10px 100%,0 50%,10px 0,calc(100% - 10px) 0,100% 50%,calc(100% - 10px) 100%,calc(100% - 11px) calc(100% - 1px),calc(100% - 2px) 50%,calc(100% - 11px) 1px,calc(100% - 10px) 0);opacity:0}
:is(#mayatnikTemplatePanel,#mayBackupDialog,#mayGifDialog,#mayAxis512PaletteDialog) .mtp-command:hover::after,:is(#mayatnikTemplatePanel,#mayBackupDialog,#mayGifDialog,#mayAxis512PaletteDialog) .mtp-command:focus-visible::after,#mayatnikTemplatePanel .mtp-path:hover::after,#mayatnikTemplatePanel .mtp-path:focus-visible::after,#mayatnikTemplatePanel summary:hover::after,#mayatnikTemplatePanel summary:focus-visible::after{opacity:1}
:is(#mayatnikTemplatePanel,#mayBackupDialog,#mayGifDialog,#mayAxis512PaletteDialog) .mtp-command:active::after,#mayatnikTemplatePanel .mtp-path:active::after{opacity:1;clip-path:polygon(10px 0,calc(100% - 10px) 0,100% 50%,calc(100% - 10px) 100%,10px 100%,0 50%,10px 0,11px 3px,4px 50%,11px calc(100% - 3px),calc(100% - 11px) calc(100% - 3px),calc(100% - 4px) 50%,calc(100% - 11px) 3px,11px 3px)}
#mayatnikTemplatePanel .mtp-command.mtp-heading-icon{width:24px;height:24px;min-height:24px;padding:0;background:transparent;clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%)}
#mayatnikTemplatePanel .mtp-heading-icon::after{display:none}
#mayatnikTemplatePanel .mtp-heading-icon svg{width:24px;height:24px;pointer-events:none}
#mayatnikTemplatePanel .mtp-heading-edge{fill:#1b2430;stroke:#6d597f;stroke-width:1}
#mayatnikTemplatePanel .mtp-heading-glyph{fill:none;stroke:var(--mtp-accent);stroke-width:1.5;stroke-linecap:square;stroke-linejoin:miter}
#mayatnikTemplatePanel .mtp-heading-icon:is(:hover,:focus-visible) .mtp-heading-edge{stroke:var(--mtp-accent)}
#mayatnikTemplatePanel .mtp-heading-icon[aria-pressed=true] .mtp-heading-edge{stroke:var(--mtp-accent);stroke-width:2}
#mayatnikTemplatePanel .mtp-heading-icon:active .mtp-heading-edge{stroke:var(--mtp-accent);stroke-width:3}
#mayatnikTemplatePanel .mtp-crumbs{display:flex;flex-wrap:wrap;gap:2px;flex:none}
#mayatnikTemplatePanel .mtp-path{width:auto;max-width:100%;min-width:32px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 12px}
#mayatnikTemplatePanel .mtp-selection{display:flex;flex-wrap:wrap;align-items:center;gap:2px;flex:none}
#mayatnikTemplatePanel .mtp-tabs{display:flex;flex-wrap:wrap;gap:2px;flex:none}
#mayatnikTemplatePanel .mtp-tabs [aria-selected=true]{outline:2px solid var(--mtp-accent);outline-offset:-2px}
#mayatnikTemplatePanel .mtp-pane{display:flex;flex-direction:column;gap:4px;flex:1;min-height:0}
#mayatnikTemplatePanel .mtp-pane[hidden],#mayatnikTemplatePanel [hidden]{display:none!important}
#mayatnikTemplatePanel .mtp-music-intro{margin:0;color:#b7c5d7}
#mayatnikTemplatePanel .mtp-music-now:empty{display:none}
#mayatnikTemplatePanel .mtp-music-pane audio{width:100%;height:36px;flex:none}
#mayatnikTemplatePanel .mtp-music-pane{overflow:auto}
#mayatnikTemplatePanel .mtp-music-preview{width:100%;aspect-ratio:285/128;min-height:128px;max-height:320px;overflow:auto;flex:none;background:#000;border:1px solid #39434f}
#mayatnikTemplatePanel .mtp-music-reader{display:block;image-rendering:pixelated}
#mayatnikTemplatePanel .mtp-music-reading{color:#b7c5d7;font:11px/1.4 monospace;flex:none}
#mayatnikTemplatePanel .mtp-music-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr));align-content:start;gap:8px 4px;padding-bottom:12px}
#mayatnikTemplatePanel[data-layout=list] .mtp-music-grid{grid-template-columns:minmax(0,1fr)}
#mayatnikTemplatePanel .mtp-music-card{min-width:0;padding:6px;border:1px solid #39434f;background:#111820;display:flex;flex-direction:column;gap:4px}
#mayatnikTemplatePanel .mtp-music-card.mtp-selected{border:2px solid var(--mtp-accent);padding:5px}
#mayatnikTemplatePanel .mtp-music-card strong{overflow-wrap:anywhere}
#mayatnikTemplatePanel .mtp-music-card p{margin:0;color:#b7c5d7;flex:1;overflow-wrap:anywhere}
#mayatnikTemplatePanel .mtp-music-builtin{color:#ba96e3;font-size:10px}
#mayatnikTemplatePanel .mtp-music-frame{display:block;width:100%;height:auto;object-fit:contain;image-rendering:pixelated;flex:none;background:#000}
#mayatnikTemplatePanel .mtp-music-frame-caption{font-size:10px;color:#b7c5d7}
#mayatnikTemplatePanel .mtp-music-actions{display:flex;flex-wrap:wrap;gap:2px}
#mayatnikTemplatePanel .mtp-music-actions a{color:inherit;text-decoration:none;font:inherit}
#mayatnikTemplatePanel .mtp-frame-actions{grid-template-columns:repeat(3,minmax(0,1fr))}
#mayatnikTemplatePanel .mtp-template-pane .mtp-dark-preview .mtp-preview{background:#fff}
#mayatnikTemplatePanel .mtp-selection input[type=color]{width:40px;height:24px;padding:2px;background:#1b2430;border:1px solid #334052;border-radius:0}
#mayatnikTemplatePanel .mtp-status{display:block;flex:none;min-height:28px;color:#b7c5d7;overflow-wrap:anywhere}
#mayatnikTemplatePanel [data-template-frame-search][aria-pressed=true]::after{opacity:1}
#mayatnikTemplatePanel .mtp-frame-search-status{align-self:center;min-width:0;color:#b7c5d7;overflow-wrap:anywhere}
#mayatnikTemplatePanel .mtp-frame-search-result .mtp-metrics{height:42px}
#mayatnikTemplatePanel [data-template-frame-count]{color:#d9b9ff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#mayatnikTemplatePanel [data-template-id^="xor-axes:"] .mtp-preview{background:#e8edf5}
#mayatnikTemplatePanel .mtp-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-content:start;align-items:start;gap:6px 2px;flex:1;min-height:100px;padding-bottom:12px}
#mayatnikTemplatePanel .mtp-card{position:relative;min-width:0;background:transparent;border:0;margin:0;padding:0}
#mayatnikTemplatePanel .mtp-preview{position:relative;display:block;aspect-ratio:1;width:100%;min-width:0;min-height:0;height:auto;padding:3px;background:#1b2430;border:1px solid transparent;border-radius:0;box-shadow:none!important;outline:none;overflow:hidden}
#mayatnikTemplatePanel .mtp-preview:hover,#mayatnikTemplatePanel .mtp-preview:focus-visible{border-color:var(--mtp-accent)}
#mayatnikTemplatePanel .mtp-selected .mtp-preview{border:2px solid var(--mtp-accent);padding:2px}
#mayatnikTemplatePanel .mtp-preview:active{border:3px solid var(--mtp-accent);padding:1px}
#mayatnikTemplatePanel .mtp-image{position:absolute;inset:3px 3px 18px;width:calc(100% - 6px);height:calc(100% - 21px);object-fit:contain;image-rendering:pixelated;pointer-events:none}
#mayatnikTemplatePanel .mtp-name{position:absolute;bottom:1px;left:2px;right:2px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;font-size:10px;line-height:14px;background:#1b2430;pointer-events:none}
#mayatnikTemplatePanel .mtp-template-pane [data-template-id] .mtp-name{position:relative;display:block;inset:auto;height:14px;margin:0 2px}
#mayatnikTemplatePanel .mtp-template-pane [data-template-id] .mtp-image{inset:3px;width:calc(100% - 6px);height:calc(100% - 6px)}
#mayatnikTemplatePanel .mtp-metrics{position:relative;display:flex;flex-direction:column;overflow:hidden;height:28px;margin:0 2px;font-size:10px;line-height:14px;background:#1b2430;pointer-events:none}
#mayatnikTemplatePanel .mtp-size,#mayatnikTemplatePanel .mtp-bits{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#mayatnikTemplatePanel .mtp-card-actions{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:1px;margin-top:2px}
#mayatnikTemplatePanel .mtp-card-actions>.mtp-command,#mayatnikTemplatePanel .mtp-more>summary{width:100%;padding:0;min-width:0;height:24px;font-size:11px;clip-path:polygon(3px 0,calc(100% - 3px) 0,100% 50%,calc(100% - 3px) 100%,3px 100%,0 50%)}
#mayatnikTemplatePanel .mtp-card-actions>.mtp-command::after,#mayatnikTemplatePanel .mtp-more>summary::after{clip-path:polygon(3px 0,4px 1px,2px 50%,4px calc(100% - 1px),3px 100%,0 50%,3px 0,calc(100% - 3px) 0,100% 50%,calc(100% - 3px) 100%,calc(100% - 4px) calc(100% - 1px),calc(100% - 2px) 50%,calc(100% - 4px) 1px,calc(100% - 3px) 0)}
#mayatnikTemplatePanel .mtp-more{position:relative;min-width:0}
#mayatnikTemplatePanel summary{list-style:none}
#mayatnikTemplatePanel summary::-webkit-details-marker{display:none}
#mayatnikTemplatePanel .mtp-more-menu{position:absolute;top:26px;right:0;z-index:2;display:flex;gap:2px;padding:2px;background:#0e1116}
#mayatnikTemplatePanel .mtp-more-menu>.mtp-command{width:28px;padding:0}
#mayatnikTemplatePanel .mtp-folder .mtp-preview{font-size:28px;text-align:center;padding-bottom:16px}
#mayatnikTemplatePanel .mtp-folder .mtp-card-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
#mayatnikTemplatePanel .mtp-drop{outline:2px dashed var(--mtp-accent);outline-offset:-2px}
#mayatnikTemplatePanel .mtp-empty{grid-column:1/-1;margin:12px 2px;color:#aebdcd;font-size:12px}
#mayatnikTemplatePanel #templateLibraryChoices,#mayatnikTemplatePanel #templateLibraryCurrent{display:none!important}
:is(#mayatnikTemplatePanel,#mayBackupDialog,#mayGifDialog,#mayAxis512PaletteDialog) button:disabled,#mayatnikTemplatePanel input:disabled{opacity:.45;cursor:default}
@media(max-width:600px){#mayatnikTemplatePanel .mtp-card-actions{grid-template-columns:repeat(3,minmax(0,1fr))}#mayatnikTemplatePanel .mtp-card-actions>.mtp-command,#mayatnikTemplatePanel .mtp-more>summary{min-height:28px;height:28px}}

/* Half diamond stays on the right viewport edge, above the library in either state. */
body.mayatnik-menu-ready #mayTemplateLauncher{position:fixed!important;top:50%!important;right:0!important;left:auto!important;bottom:auto!important;transform:translateY(-50%)!important;translate:none!important;width:24px!important;min-width:24px!important;max-width:24px!important;height:48px!important;padding:0!important;margin:0!important;z-index:2147483646!important;--c:#d9b9ff}
/* Keep the launcher in its saved slot while open; it also closes the library. */
#mayTemplateLauncher>.pt-l{position:relative;display:flex;align-items:center;justify-content:center;width:24px!important;min-width:24px!important;height:48px!important;padding:0!important;margin:0!important;border:0!important;background:transparent!important;clip-path:polygon(100% 0,100% 100%,0 50%)!important;cursor:pointer;color:var(--c)}
#mayTemplateLauncher .may-template-diamond{position:absolute;inset:0;width:24px;height:48px;fill:#1b2430;stroke:#6d597f;stroke-width:1px;pointer-events:none}
#mayTemplateLauncher :is(.may-template-puzzle,.may-template-hide){width:14px;height:14px;position:absolute;top:17px;left:9px;fill:none;stroke:currentColor;stroke-width:1.5px;pointer-events:none}
#mayTemplateLauncher .may-template-hide{display:none}
#mayTemplateLauncher>.pt-l[aria-expanded=true] .may-template-puzzle{display:none}
#mayTemplateLauncher>.pt-l[aria-expanded=true] .may-template-hide{display:block}
#mayTemplateLauncher>.pt-l:is(:hover,:focus-visible) .may-template-diamond{stroke:var(--c)}
#mayTemplateLauncher>.pt-l[aria-pressed=true] .may-template-diamond{stroke:var(--c);stroke-width:2px}
#mayTemplateLauncher>.pt-l:active .may-template-diamond{stroke:var(--c);stroke-width:3px}
/* Shared library layouts: one set of cards/actions, persistent presentation only. */
#mayatnikTemplatePanel .mtp-layout{display:flex;gap:2px;flex:none}
:is(#mayatnikTemplatePanel,#mayBackupDialog,#mayGifDialog,#mayAxis512PaletteDialog) .mtp-command[aria-pressed=true]::after{opacity:1}
#mayatnikTemplatePanel .mtp-list-head,#mayatnikTemplatePanel .mtp-capture-metrics{display:none}
#mayatnikTemplatePanel .mtp-template-pane [data-template-id] .mtp-card-actions{grid-template-columns:repeat(4,minmax(0,1fr))}
#mayatnikTemplatePanel[data-layout=list] .mtp-grid{grid-template-columns:minmax(0,1fr);row-gap:2px}
#mayatnikTemplatePanel[data-layout=list] .mtp-list-head{display:grid;grid-template-columns:minmax(146px,1fr) 110px 236px;gap:4px;min-width:504px;padding:0 2px;color:var(--mtp-accent)}
#mayatnikTemplatePanel[data-layout=list] .mtp-card{height:36px;padding:2px;background:#1b2430;align-items:center}
#mayatnikTemplatePanel[data-layout=list] .mtp-card.mtp-selected{outline:2px solid var(--mtp-accent);outline-offset:-2px}
#mayatnikTemplatePanel[data-layout=list] .mtp-card .mtp-preview{height:32px;min-height:32px;aspect-ratio:auto;padding:0;border:0;background:transparent}
#mayatnikTemplatePanel[data-layout=list] .mtp-preview:is(:hover,:focus-visible){outline:1px solid var(--mtp-accent);outline-offset:-1px}
#mayatnikTemplatePanel[data-layout=list] .mtp-image{display:block;position:static;inset:auto;width:32px;height:32px;object-fit:contain;flex:none}
#mayatnikTemplatePanel[data-layout=list] .mtp-dark-preview .mtp-image{background:#fff}
#mayatnikTemplatePanel[data-layout=list] .mtp-card-actions{height:32px;margin:0;gap:2px;justify-self:end}
#mayatnikTemplatePanel[data-layout=list] .mtp-card-actions>.mtp-command,#mayatnikTemplatePanel[data-layout=list] .mtp-more>summary{width:32px;height:32px;min-height:32px;line-height:32px}
#mayatnikTemplatePanel[data-layout=list] .mtp-more-menu{top:34px}
#mayatnikTemplatePanel[data-layout=list] [data-template-id]{display:grid;grid-template-columns:32px minmax(110px,1fr) 110px 236px;gap:4px;min-width:504px}
#mayatnikTemplatePanel[data-layout=list] [data-template-id] .mtp-preview{grid-column:1/3;grid-row:1}
#mayatnikTemplatePanel[data-layout=list] [data-template-id] .mtp-name{grid-column:2;grid-row:1;z-index:1;height:auto;font-size:12px;padding:0 4px;background:transparent}
#mayatnikTemplatePanel[data-layout=list] [data-template-id] .mtp-metrics{grid-column:3;grid-row:1;font-size:11px;background:transparent}
#mayatnikTemplatePanel[data-layout=list] [data-template-id] .mtp-card-actions{grid-column:4;grid-row:1;grid-template-columns:repeat(7,32px)}
#mayatnikTemplatePanel[data-layout=list] .mtp-folder,#mayatnikTemplatePanel[data-layout=list] .mtp-capture-card{display:grid;grid-template-columns:minmax(110px,1fr) 110px 100px;gap:4px;min-width:334px}
#mayatnikTemplatePanel[data-layout=list] .mtp-folder .mtp-preview,#mayatnikTemplatePanel[data-layout=list] .mtp-capture-card .mtp-preview{display:flex;align-items:center;gap:6px;font-size:12px;text-align:left}
#mayatnikTemplatePanel[data-layout=list] .mtp-folder .mtp-name,#mayatnikTemplatePanel[data-layout=list] .mtp-capture-card .mtp-name{position:static;min-width:0;font-size:12px;background:transparent}
#mayatnikTemplatePanel[data-layout=list] .mtp-capture-metrics{display:block;font-size:11px}
#mayatnikTemplatePanel[data-layout=list] .mtp-capture-card .mtp-card-actions{grid-template-columns:repeat(3,32px)}
#mayatnikTemplatePanel[data-layout=list] .mtp-folder .mtp-card-actions{grid-column:3;grid-template-columns:repeat(2,32px)}
#mayatnikTemplatePanel .mtp-layer-list{display:flex;flex-direction:column;gap:3px;--mtp-accent:#73e4a5}
#mayatnikTemplatePanel .mtp-layer-row{display:grid;grid-template-columns:minmax(100px,1fr) 45px 36px;gap:4px;align-items:center}
#mayatnikTemplatePanel .mtp-layer-row .mtp-command{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#mayatnikTemplatePanel .mtp-layer-opacity{text-align:right;color:#b7c5d7}
#mayatnikTemplatePanel .mtp-toolbar{display:flex;flex-wrap:wrap;gap:2px;flex:none}
html.may-library-detached body{margin:0;padding:0!important;background:#0e1116;color:#dfe6f5}
html.may-library-detached #mayatnikTemplatePanel{inset:0;width:100%!important;border:0}
html.may-library-detached .mtp-resize{display:none!important}
html.may-library-disconnected #mayatnikTemplatePanel{display:none!important}
#mayLibraryConnection{position:fixed;inset:0;z-index:2147483647;padding:24px;background:#0e1116;color:#dfe6f5;font:16px/1.5 system-ui,sans-serif}
#mayLibraryConnection[hidden]{display:none}

/* Compact library layout diamonds retain their existing SVG and state. */
#mayatnikTemplatePanel .mtp-layout-diamond{width:24px;height:24px;padding:0;line-height:1;background:transparent;clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%)}
#mayatnikTemplatePanel .mtp-layout-diamond::after{display:none}
#mayatnikTemplatePanel .mtp-layout-diamond svg{width:24px;height:24px;pointer-events:none}
#mayatnikTemplatePanel .mtp-layout-edge{fill:#1b2430;stroke:#6d597f;stroke-width:1}
#mayatnikTemplatePanel .mtp-layout-icon{fill:none;stroke:currentColor;stroke-width:1.6;stroke-linejoin:miter;stroke-linecap:square}
#mayatnikTemplatePanel .mtp-layout-diamond:is(:hover,:focus-visible) .mtp-layout-edge{stroke:var(--mtp-accent)}
#mayatnikTemplatePanel .mtp-layout-diamond[aria-pressed=true] .mtp-layout-edge{stroke:var(--mtp-accent);stroke-width:2}
#mayatnikTemplatePanel .mtp-layout-diamond:active .mtp-layout-edge{stroke:var(--mtp-accent);stroke-width:3}
/* Explorer shell: one navigation tree and shared commands for every library. */
#mayatnikTemplatePanel{container-type:inline-size;overflow:hidden;top:var(--may-library-field-top,0px);bottom:auto;right:var(--may-library-field-right,0px);height:var(--may-library-field-height,100dvh)}
#mayatnikTemplatePanel .mtp-workspace{display:grid;grid-template-columns:minmax(0,1fr);flex:1;min-height:0;min-width:0;overflow:auto;overscroll-behavior:contain}
#mayatnikTemplatePanel,#mayatnikTemplatePanel .mtp-workspace{scrollbar-width:none}
#mayatnikTemplatePanel::-webkit-scrollbar,#mayatnikTemplatePanel .mtp-workspace::-webkit-scrollbar{display:none;width:0;height:0}
#mayatnikTemplatePanel .mtp-main{display:flex;flex-direction:column;gap:4px;min-width:0}
#mayatnikTemplatePanel .mtp-navigation{position:relative;min-width:0;flex:none}
#mayatnikTemplatePanel .mtp-navigation>summary{display:flex;max-width:100%;list-style:none}
#mayatnikTemplatePanel .mtp-navigation>summary::-webkit-details-marker{display:none}
#mayatnikTemplatePanel .mtp-tabs{flex-direction:row;flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;touch-action:pan-x;max-width:100%;padding:2px 0}
#mayatnikTemplatePanel .mtp-tabs .mtp-command{flex:0 0 60px;width:60px;max-width:60px;height:24px;min-height:24px;padding:0 4px;font-size:10px;white-space:nowrap;overflow:hidden}
#mayatnikTemplatePanel .mtp-folder-tree{position:absolute;left:0;top:26px;z-index:5;display:flex;flex-direction:column;gap:2px;width:min(300px,calc(100cqw - 12px));max-height:min(240px,40dvh);overflow:auto;overscroll-behavior:contain;padding:4px;background:#0e1116;border:1px solid #334052;min-width:0}
#mayatnikTemplatePanel .mtp-navigation:not([open])>.mtp-folder-tree{display:none}
#mayatnikTemplatePanel .mtp-folder-empty{margin:4px;color:#aebdcd}
#mayatnikTemplatePanel .mtp-folder-tree .mtp-command{width:100%;justify-content:flex-start;padding-left:calc(10px + min(var(--mtp-depth),3)*8px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#mayatnikTemplatePanel .mtp-location{display:flex;align-items:center;gap:4px;min-width:0}
#mayatnikTemplatePanel .mtp-location .mtp-command{width:78px}
#mayatnikTemplatePanel .mtp-address{flex:1;min-width:0;overflow-wrap:anywhere;color:#c4b1e2}
#mayatnikTemplatePanel .mtp-section-commands{display:flex;flex-wrap:wrap;gap:2px}
#mayatnikTemplatePanel .mtp-viewbar{display:flex;align-items:center;justify-content:flex-end;gap:4px;flex-wrap:wrap;min-width:0;flex:none;padding-top:4px;background:#0e1116}
#mayatnikTemplatePanel .mtp-search{min-width:0;width:120px;flex:0 1 120px;max-width:100%;height:28px;padding:3px 6px;border:1px solid #526075;border-radius:0;background:#1b2430;color:inherit;font:inherit;user-select:text}
#mayatnikTemplatePanel .mtp-file-commands{display:flex;flex:0 1 184px;width:184px;max-width:100%;flex-wrap:nowrap;gap:2px;min-width:0}
#mayatnikTemplatePanel .mtp-file-commands .mtp-command{flex:1 1 60px;width:60px;min-width:0;max-width:60px;height:24px;overflow:hidden;white-space:nowrap;padding:0 2px;font-size:9px}
#mayatnikTemplatePanel .mtp-crumbs,#mayatnikTemplatePanel .mtp-pane>[data-frame-save],#mayatnikTemplatePanel .mtp-pane>[data-view-save],#mayatnikTemplatePanel .mtp-pane>[data-settings-save],#mayatnikTemplatePanel .mtp-selection>[data-library-save]{display:none}
#mayatnikTemplatePanel .mtp-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,120px),1fr))}
#mayatnikTemplatePanel .mtp-layer-row{grid-template-columns:minmax(0,1fr) 35px 28px;gap:2px;min-width:0}
#mayatnikTemplatePanel[data-layout=list] .mtp-list-head{grid-template-columns:minmax(0,1fr) 90px 236px;min-width:0}
#mayatnikTemplatePanel[data-layout=list] [data-template-id]{grid-template-columns:32px minmax(0,1fr) 90px 236px;min-width:0}
#mayatnikTemplatePanel[data-layout=list] .mtp-folder,#mayatnikTemplatePanel[data-layout=list] .mtp-capture-card{grid-template-columns:minmax(0,1fr) 80px 100px;min-width:0}
@container(max-width:700px){
 #mayatnikTemplatePanel[data-layout=list] .mtp-list-head{display:none}
 #mayatnikTemplatePanel[data-layout=list] [data-template-id]{grid-template-columns:32px minmax(0,1fr);height:auto;min-height:36px}
 #mayatnikTemplatePanel[data-layout=list] [data-template-id] .mtp-metrics{grid-column:2;grid-row:2;height:auto;flex-direction:row;gap:4px}
 #mayatnikTemplatePanel[data-layout=list] [data-template-id] .mtp-card-actions{grid-column:1/-1;grid-row:3;display:flex;flex-wrap:wrap;justify-self:start;height:auto}
 #mayatnikTemplatePanel[data-layout=list] .mtp-folder,#mayatnikTemplatePanel[data-layout=list] .mtp-capture-card{grid-template-columns:minmax(0,1fr);height:auto}
 #mayatnikTemplatePanel[data-layout=list] .mtp-folder .mtp-card-actions,#mayatnikTemplatePanel[data-layout=list] .mtp-capture-card .mtp-card-actions{grid-column:1;justify-self:start}
}
@container(max-width:430px){
 #mayatnikTemplatePanel .mtp-folder-tree .mtp-command{max-width:100%}
 #mayatnikTemplatePanel .mtp-location{align-items:flex-start;flex-wrap:wrap}
 #mayatnikTemplatePanel .mtp-address{flex-basis:100%}
 #mayatnikTemplatePanel .mtp-file-commands{max-width:100%}
}

#mayatnikTemplatePanel .mtp-section-commands>.mtp-command,#mayatnikTemplatePanel .mtp-selection>[data-library-export]{width:24px;min-width:24px;max-width:24px;height:24px;min-height:24px;padding:0}
#mayatnikTemplatePanel [data-section-delete]{--mtp-accent:#ff625c}
#mayatnikTemplatePanel [data-section-delete] .mtp-heading-edge{stroke:#ff625c}
#mayatnikTemplatePanel [data-delete-glyph] .mtp-heading-glyph{stroke:#ff625c}
#mayatnikTemplatePanel [data-section-delete]:disabled{opacity:.7}
#mayTemplateLimitDialog{max-width:calc(100% - 24px);padding:12px;background:#0e1116;color:#dfe6f5;border:1px solid #b48cff}
#mayTemplateLimitDialog::backdrop{background:#0009}
#mayTemplateLimitDialog label{display:flex;flex-direction:column;gap:6px}
#mayTemplateLimitDialog input{width:120px;max-width:100%;height:28px;background:#1b2430;color:inherit;border:1px solid #526075;user-select:text}
#mayTemplateLimitDialog .mtp-limit-actions{display:flex;flex-wrap:wrap;gap:2px;margin-top:8px}
#mayAxis512PaletteDialog{--mtp-accent:#b48cff;box-sizing:border-box;max-width:calc(100% - 24px);padding:12px;background:#0e1116;color:#dfe6f5;border:1px solid var(--mtp-accent);font:12px/1.35 system-ui,sans-serif}
#mayAxis512PaletteDialog::backdrop{background:#0009}
#mayAxis512PaletteTitle{margin:0 0 8px;font-size:14px}
#mayAxis512PaletteDialog .mtp-palette-row{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:2px 0}
#mayAxis512PaletteDialog label{display:flex;align-items:center;gap:6px}
#mayAxis512PaletteDialog input[type=color]{width:44px;height:24px;padding:2px;border:1px solid #526075;background:#1b2430;cursor:pointer}
#mayAxis512PaletteDialog input:focus-visible{outline:1px solid var(--mtp-accent);outline-offset:1px}
#mayAxis512PaletteDialog input:disabled{opacity:.45;cursor:default}
#mayAxis512PaletteDialog .mtp-palette-row small,#mayAxis512PaletteDialog .mtp-palette-notice{color:#c4b1e2}
#mayAxis512PaletteDialog .mtp-palette-notice:not(:empty){display:block;margin:4px 0}
#mayAxis512PaletteDialog .mtp-limit-actions{display:flex;flex-wrap:wrap;gap:2px;margin-top:8px}
#mayAxis512PaletteDialog .mtp-command{background:linear-gradient(180deg,#293646,#1b2430 50%,#263442)}

#mayatnikTemplatePanel .mtp-sequences{min-width:0;overflow:hidden}
/* Template list cards keep text/actions left and use the full right side for preview. */
#mayatnikTemplatePanel[data-layout=list] .mtp-template-pane .mtp-list-head{display:none}
#mayatnikTemplatePanel[data-layout=list] .mtp-template-pane [data-template-id]{grid-template-columns:minmax(0,1fr) minmax(72px,38%);grid-template-rows:auto auto auto;gap:2px 4px;height:auto;min-height:104px;min-width:0;align-items:start}
#mayatnikTemplatePanel[data-layout=list] .mtp-template-pane [data-template-id] .mtp-preview{grid-column:2;grid-row:1 / 4;align-self:stretch;position:relative;aspect-ratio:auto;width:100%;height:100%;min-height:0}
#mayatnikTemplatePanel[data-layout=list] .mtp-template-pane [data-template-id] .mtp-image{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;image-rendering:pixelated}
#mayatnikTemplatePanel[data-layout=list] .mtp-template-pane [data-template-id] .mtp-name{grid-column:1;grid-row:1;position:static;inset:auto;height:auto;min-width:0;margin:0;padding:0 2px;white-space:normal;overflow-wrap:anywhere;line-height:16px}
#mayatnikTemplatePanel[data-layout=list] .mtp-template-pane [data-template-id] .mtp-metrics{grid-column:1;grid-row:2;height:auto;min-width:0;margin:0;flex-direction:column;gap:0}
#mayatnikTemplatePanel[data-layout=list] .mtp-template-pane [data-template-id] .mtp-card-actions{grid-column:1;grid-row:3;display:flex;flex-wrap:wrap;justify-self:start;align-self:start;width:100%;height:auto;margin:0}
#mayatnikTemplatePanel .mtp-template-pane [data-template-id] .mtp-card-actions{display:flex;flex-wrap:wrap;gap:2px}
#mayatnikTemplatePanel .mtp-template-pane [data-template-id] .mtp-card-actions>.mtp-heading-icon{flex:none;width:24px;min-width:24px;max-width:24px;height:24px;min-height:24px;line-height:24px;clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%)}
#mayatnikTemplatePanel .mtp-template-pane [data-template-id] .mtp-name{pointer-events:auto;cursor:pointer}
#mayatnikTemplatePanel .mtp-template-pane [data-template-id] .mtp-name:focus-visible{outline:1px solid var(--mtp-accent);outline-offset:-1px}
#mayatnikTemplatePanel .mtp-sequences p{margin:4px 0;color:#aab8cc;font-size:11px}
#mayatnikTemplatePanel .mtp-sequences label{display:block;font-size:12px}
#mayatnikTemplatePanel .mtp-sequences textarea{display:block;width:100%;height:150px;box-sizing:border-box;resize:vertical;white-space:pre;overflow:auto;background:#111823;color:#dfe6f5;border:1px solid #394657;font:12px/1.5 monospace;user-select:text;-webkit-user-select:text}
#mayatnikTemplatePanel .mtp-sequence-actions{display:flex;flex-wrap:wrap;gap:2px;margin:4px 0}
#mayatnikTemplatePanel .mtp-sequence-actions input{min-width:0;width:120px;box-sizing:border-box;background:#111823;color:#dfe6f5;border:1px solid #394657;height:24px}
#mayatnikTemplatePanel .mtp-sequence-actions input[type=number]{width:65px}
#mayatnikTemplatePanel .mtp-sequence-generator{display:flex;flex-wrap:wrap;align-items:end;gap:2px;margin:4px 0}
#mayatnikTemplatePanel .mtp-sequence-generator label{min-width:0;font-size:11px}
#mayatnikTemplatePanel .mtp-sequence-generator input:not([type=checkbox]),#mayatnikTemplatePanel .mtp-sequence-generator select{display:block;box-sizing:border-box;min-width:0;width:90px;height:24px;background:#111823;color:#dfe6f5;border:1px solid #394657}
#mayatnikTemplatePanel .mtp-sequence-generator input[type=text]{width:120px}
#mayatnikTemplatePanel .mtp-sequence-generator input[type=checkbox]{vertical-align:middle}
#mayatnikTemplatePanel .mtp-sequence-notice,#mayatnikTemplatePanel .mtp-sequence-summary{display:block;font:11px/1.5 'Segoe UI',sans-serif;color:#b9c7db;margin:3px 0}
#mayatnikTemplatePanel .mtp-sequence-rows{max-height:50dvh;overflow:auto;max-width:100%;margin:4px 0;padding:0;font:12px/1.5 monospace;background:#0e1116}
#mayatnikTemplatePanel .mtp-sequence-rows table{border-collapse:collapse;width:100%;table-layout:fixed;text-align:left}
#mayatnikTemplatePanel .mtp-sequence-rows th{position:sticky;top:0;background:#202938;color:#d4deec;z-index:1}
#mayatnikTemplatePanel .mtp-sequence-rows th,#mayatnikTemplatePanel .mtp-sequence-rows td{padding:4px 8px;vertical-align:top;border-bottom:1px solid #303949;white-space:pre-line;overflow-wrap:anywhere}
#mayatnikTemplatePanel .mtp-sequence-rows td{color:#8d9bb0}
#mayatnikTemplatePanel .mtp-sequence-rows th:nth-child(1){width:46px}
#mayatnikTemplatePanel .mtp-sequence-rows th:nth-child(2){width:30%}
#mayatnikTemplatePanel .mtp-sequence-rows th:nth-child(3){width:80px;overflow-wrap:normal}
#mayatnikTemplatePanel .mtp-sequence-rows [data-column=sequence] code{display:block;max-width:100%;overflow-x:auto;white-space:pre;overflow-wrap:normal}

#mayatnikTemplatePanel .mtp-sequence-rows .is-found td,#mayatnikTemplatePanel .mtp-sequence-rows .is-selected td{color:inherit}
#mayatnikTemplatePanel .mtp-sequence-rows .is-found{color:#ffd646;background:#453016}
#mayatnikTemplatePanel .mtp-sequence-rows .is-manual-found{color:#ffd646;background:#453016}
#mayatnikTemplatePanel .mtp-sequence-rows .is-manual-found td{color:inherit}
#mayatnikTemplatePanel .mtp-sequence-rows .mtp-manual-prefix{color:#ff4040;background:transparent}
#mayatnikTemplatePanel .mtp-sequence-rows .is-manual-partial [data-column=sequence] code{color:#8d9bb0}
#mayatnikTemplatePanel .mtp-sequence-rows tbody td{padding:1px 4px!important;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#mayatnikTemplatePanel .mtp-sequence-rows [data-column=sequence] code{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
#mayatnikTemplatePanel .mtp-sequence-notice:empty,#mayatnikTemplatePanel .mtp-sequence-summary:empty{display:none}
#mayatnikTemplatePanel .mtp-sequence-rows .mtp-resizable-sequences th{width:auto!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:1px 8px 1px 4px!important;line-height:16px}
#mayatnikTemplatePanel .mtp-sequence-col-resize{position:absolute;right:0;top:0;bottom:0;width:7px;cursor:col-resize;touch-action:none;user-select:none}
#mayatnikTemplatePanel .mtp-sequence-col-resize:is(:hover,:focus-visible){outline:1px solid #69edff;outline-offset:-1px;background:#69edff20}
.may-template-limit-notice{position:fixed;top:60px;left:50%;transform:translateX(-50%);z-index:2147483646;box-sizing:border-box;width:max-content;max-width:calc(100vw - 24px);padding:8px 12px;background:#111823;color:#ffe969;border:1px solid #ffe969;font:13px/1.4 'Segoe UI',sans-serif;pointer-events:none}
.may-template-limit-notice[hidden]{display:none}

#mayatnikTemplatePanel .mtp-sequence-rows .is-selected{color:#edffff;background:#124b55;box-shadow:inset 3px 0 #69edff}
#mayatnikTemplatePanel .mtp-sequence-rows .is-selected.is-manual-found{color:#ffd646;background:#453016}

#mayLibraryExport{box-sizing:border-box;width:min(620px,94vw);max-height:90vh;overflow:auto;padding:16px;color:#e8edf5;background:#0e1116;border:1px solid #b48cff;font:13px system-ui,sans-serif}
#mayLibraryExport::backdrop{background:#000a}
#mayLibraryExport h3,#mayLibraryExport h4{margin:8px 0}
#mayLibraryExport p{line-height:1.45}
#mayLibraryExport .mtp-export-commands{display:flex;gap:2px;flex-wrap:wrap;margin:10px 0}
#mayLibraryExport .mtp-export-list{max-height:45vh;overflow:auto;border-block:1px solid #465066;padding:6px 0}
#mayLibraryExport .mtp-export-list label{display:flex;align-items:center;gap:8px;min-height:30px;padding:2px 4px;overflow-wrap:anywhere}
#mayLibraryExport .mtp-export-list input{flex:none;width:18px;height:18px}
#mayLibraryExport .mtp-status{display:block;white-space:normal;overflow-wrap:anywhere}

/* Mobile library is an overlay; desktop width and canvas geometry stay independent. */
body.may-mobile-menu.may-template-panel-open{padding-right:0}
body.may-mobile-menu #mayatnikTemplatePanel{left:var(--may-library-vv-left,0px);right:auto;top:max(var(--may-mobile-bar-height,36px),var(--may-library-vv-top,0px));bottom:auto;width:var(--may-template-panel-width);height:calc(var(--may-library-vv-bottom,100dvh) - max(var(--may-mobile-bar-height,36px),var(--may-library-vv-top,0px)));padding-bottom:max(8px,env(safe-area-inset-bottom));overflow-x:hidden}
body.may-mobile-menu .mtp-resize{display:none!important}
/* Field controls remain available above the mobile library too. */
body.may-mobile-menu #mayatnikTemplatePanel .mtp-heading{position:sticky;top:0;z-index:4;background:#0e1116;min-height:36px}
body.may-mobile-menu #mayatnikTemplatePanel .mtp-workspace{display:flex;flex-direction:column;flex:1}
body.may-mobile-menu #mayatnikTemplatePanel .mtp-sequence-rows{font-size:11px;max-height:55dvh}
body.may-mobile-menu #mayatnikTemplatePanel .mtp-sequence-rows :is(th,td){padding:5px 4px}
body.may-mobile-menu #mayatnikTemplatePanel .mtp-sequence-rows th:first-child{width:30px}
body.may-mobile-menu #mayatnikTemplatePanel .mtp-sequence-rows th:nth-child(3){width:62px}
body.may-mobile-menu #mayatnikTemplatePanel .mtp-sequences textarea{height:90px}
body.may-mobile-menu #mayatnikTemplatePanel :is(input:not([type=checkbox]):not([type=color]),select){font-size:16px;min-height:32px}

/* Sequence generator commands; semantic labels remain in accessible names. */
#mayatnikTemplatePanel .mtp-sequence-actions{display:grid;grid-template-columns:60px minmax(0,1fr) 60px;gap:2px;min-width:0;flex-wrap:nowrap}
#mayatnikTemplatePanel .mtp-sequence-actions>*{box-sizing:border-box;min-width:0;width:100%;max-width:100%}
#mayatnikTemplatePanel .mtp-sequence-actions .mtp-command{width:60px;min-width:0;height:24px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#mayatnikTemplatePanel .mtp-sequence-generator{display:grid;grid-template-columns:repeat(4,minmax(0,1fr)) 18px 60px 60px;align-items:center;gap:2px;min-width:0}
#mayatnikTemplatePanel .mtp-sequence-generator label{display:block;min-width:0;overflow:hidden}
#mayatnikTemplatePanel .mtp-sequence-generator :is(input:not([type=checkbox]),select){width:100%;min-width:0;max-width:100%;height:24px}
#mayatnikTemplatePanel .mtp-sequence-generator .mtp-command{width:60px;min-width:0;height:24px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.may-mobile-menu #mayatnikTemplatePanel .mtp-sequence-generator{grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-flow:row}
body.may-mobile-menu #mayatnikTemplatePanel .mtp-sequence-generator>label:nth-child(-n+4){grid-column:span 2}
body.may-mobile-menu #mayatnikTemplatePanel .mtp-sequence-generator>label:nth-child(5){grid-column:1 / span 2;grid-row:3}
body.may-mobile-menu #mayatnikTemplatePanel .mtp-sequence-generator>.mtp-command{grid-row:3;justify-self:end}
#mayatnikTemplatePanel .mtp-snake-catalog{margin:2px 0;max-width:100%;min-width:0}
#mayatnikTemplatePanel .mtp-snake-catalog :is(select,button){max-width:100%;min-width:0}
#mayatnikTemplatePanel .mtp-snake-catalog ol{padding-left:22px;margin:2px 0}
#mayatnikTemplatePanel .mtp-snake-catalog li button{display:block;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left}

/* 257: current-frame provenance belongs to its existing sequence row. */
#mayatnikTemplatePanel .mtp-current-context{caption-side:top;text-align:left;font:11px/1.3 monospace;max-width:100%;padding:2px 4px}
#mayatnikTemplatePanel .mtp-current-context>span{display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0;contain:inline-size;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#mayatnikTemplatePanel .mtp-current-context:empty{display:none}
#mayatnikTemplatePanel .mtp-current-matches{min-width:0;max-width:100%;margin:2px 0;color:#c4cfde}
#mayatnikTemplatePanel .mtp-current-matches summary,#mayatnikTemplatePanel .mtp-current-line{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;max-width:100%;min-width:0}
#mayatnikTemplatePanel .mtp-current-matches summary{cursor:pointer;color:#ffbd60}
#mayatnikTemplatePanel .mtp-current-hit+ .mtp-current-hit{border-top:1px solid #394657;margin-top:2px;padding-top:2px}

/* 265: backup commands in the title; sequence actions in the editor corner. */
#mayatnikTemplatePanel .mtp-heading .mtp-header-path{flex:1 1 0}
#mayatnikTemplatePanel .mtp-heading .mtp-file-commands{flex:0 0 184px}
#mayatnikTemplatePanel .mtp-toolbar:not(:has(>[data-window-notice]:not([hidden]),>[data-template-frame-search]:not([hidden]))){display:none}
#mayatnikTemplatePanel[data-tab=sequences] .mtp-main{position:relative}
#mayatnikTemplatePanel[data-tab=sequences] .mtp-section-commands{position:absolute;top:2px;right:2px;z-index:2;flex-wrap:nowrap;background:#111823}
#mayatnikTemplatePanel[data-tab=sequences] .mtp-sequences textarea{padding-right:106px}
#mayatnikTemplatePanel .mtp-sequences textarea::-webkit-scrollbar,
#mayatnikTemplatePanel .mtp-sequence-rows::-webkit-scrollbar{width:0}

/* Live controls keep their existing handlers and the shared 120 x 24 geometry. */
#mayatnikTemplatePanel .mtp-live-settings{margin-bottom:8px}
#mayatnikTemplatePanel .mtp-live-settings h3{margin:0 0 4px;font:inherit;color:#c29bff}
#mayatnikTemplatePanel .mtp-live-controls{display:flex;flex-direction:column;align-items:flex-start;gap:2px;--c:#c29bff;--gz-w:120px;--gz-h:24px;--gz-n:12px;--gz-bg:#1b2430;--gz-txt:#dfe6f5;--gz-mut:#8592ad;color:var(--gz-txt);font:12px/1.2 "Segoe UI",sans-serif}
#mayatnikTemplatePanel .mtp-gif-controls{--c:#73e4a5}
#mayatnikTemplatePanel .mtp-gif-controls>.may-xorrom-control{--c:#73e4a5}
#mayatnikTemplatePanel .mtp-live-controls>.gz-hx{position:relative;flex-shrink:0;margin:0}
#mayatnikTemplatePanel .mtp-live-controls [hidden]{display:none!important}

/* Sequence-table layout is semantic: order and widths follow column keys. */
#mayatnikTemplatePanel .mtp-resizable-sequences th{cursor:grab;touch-action:none;user-select:none}
#mayatnikTemplatePanel .mtp-resizable-sequences.is-column-dragging th{cursor:grabbing}
#mayatnikTemplatePanel .mtp-resizable-sequences th.is-column-target{box-shadow:inset 2px 0 #69edff}
#mayatnikTemplatePanel .mtp-resizable-sequences[data-text-align=center] :is(th,td){text-align:center}
#mayatnikTemplatePanel .mtp-resizable-sequences[data-text-align=left] :is(th,td){text-align:left}
#mayatnikTemplatePanel .mtp-sequence-rows .mtp-reverse-masked-bit{color:#d78dff}
#mayatnikTemplatePanel .mtp-sequence-rows .is-navigable{cursor:pointer}
#mayatnikTemplatePanel .mtp-sequence-rows .is-navigable:focus-visible{outline:1px solid #69edff;outline-offset:-1px}
#mayatnikTemplatePanel .mtp-sequence-table-actions{display:flex;gap:2px;margin:2px 0}
#mayatnikTemplatePanel .mtp-sequence-table-actions .mtp-command[aria-pressed=true]::after{opacity:1}

#mayAtlasOccurrences {
  max-width: min(32rem, calc(100vw - 2rem)); max-height: min(36rem, calc(100dvh - 2rem));
  color: #edf4fa; background: #141c25; border: 1px solid #516776; padding: 1rem;
  scrollbar-width: none;
}
#mayAtlasOccurrences::backdrop { background: #080c13b8; }
#mayAtlasOccurrences h2 { margin: 0 0 .65rem; font-size: 1.05rem; }
#mayAtlasOccurrences ul { list-style: none; padding: 0; margin: 0 0 .75rem; }
#mayAtlasOccurrences li { display: flex; align-items: center; gap: .6rem; margin: .28rem 0; }
#mayAtlasOccurrences li span { font-size: .86rem; color: #b6cada; }
