
.tge{--b:#a5bcc5;--bg:#fff;--fg:var(--dark,#243e39);--mut:#f0f4f5;--ac:var(--green,#087b70);border:1.5px solid var(--b);border-radius:10px;background:var(--bg);color:var(--fg);font-family:inherit;transition:border-color .15s ease,box-shadow .15s ease;overflow:hidden;box-sizing:border-box;width:100%}
.tge:focus-within{border-color:var(--ac);box-shadow:0 0 0 3px rgba(8,123,112,.18)}
html[data-dashboard-theme=dark] .tge{--b:#3e5e54;--bg:#11211b;--fg:#e0eee8;--mut:#172822;--ac:#7bd4be}
html[data-dashboard-theme=dark] .tge:focus-within{border-color:var(--ac);box-shadow:0 0 0 3px rgba(123,212,190,.22)}
@media(prefers-color-scheme:dark){:root:not([data-dashboard-theme=light]) .tge{--b:#3e5e54;--bg:#11211b;--fg:#e0eee8;--mut:#172822;--ac:#7bd4be}:root:not([data-dashboard-theme=light]) .tge:focus-within{border-color:var(--ac);box-shadow:0 0 0 3px rgba(123,212,190,.22)}}
.tge-bar{display:flex;flex-wrap:wrap;gap:3px;padding:5px 8px;border-bottom:1.5px solid var(--b);background:var(--mut);border-radius:8px 8px 0 0;min-height:38px;align-items:center}
.tge-bar button{min-width:32px;height:32px;padding:0 6px;border:1px solid transparent;border-radius:6px;background:transparent;color:inherit;font:inherit;font-size:13px;cursor:pointer;touch-action:manipulation;display:inline-flex;align-items:center;justify-content:center;transition:background .12s,border-color .12s}
.tge-bar button:hover{background:var(--bg);border-color:var(--b)}
.tge-bar button.on{background:var(--ac);color:#fff}
html[data-dashboard-theme=dark] .tge-bar button.on{background:#266c58;color:#fff}
.tge-tops{display:flex;flex-wrap:wrap;gap:3px;border-inline-start:1px solid var(--b);padding-inline-start:6px}
.tge-tops[hidden],.tge-pop[hidden]{display:none}
.tge-pop{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:8px 12px;border-bottom:1.5px solid var(--b);background:var(--mut)}
.tge-pop label{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--fg)}
.tge-pop input{height:34px;padding:0 8px;border:1.5px solid var(--b);border-radius:6px;background:var(--bg);color:inherit;font-size:13px}
.tge-pop input[type=url]{flex:1;min-width:180px}.tge-pop input[type=number]{width:60px}
.tge-pop button{height:34px;padding:0 12px;border:0;border-radius:6px;background:var(--ac);color:#fff;font:inherit;font-size:13px;cursor:pointer}
html[data-dashboard-theme=dark] .tge-pop button{background:#266c58;color:#fff}
.tge-pop button.x{background:transparent;color:inherit;border:1.5px solid var(--b)}
.tge-ed{position:relative;min-height:150px;max-height:50vh;overflow:auto;padding:12px 14px;font-size:14px;line-height:1.8;white-space:pre-wrap;word-break:break-word;outline:none;text-align:right;box-sizing:border-box;background:var(--bg);color:var(--fg)}
.tge-ed[data-empty]::before{content:attr(data-ph);position:absolute;opacity:.5;pointer-events:none;font-size:13px}
.tge-ed a{color:var(--ac);text-decoration:underline}
.tge-ed code,.tge-ed pre{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:13px;background:var(--mut);border-radius:6px;direction:ltr;unicode-bidi:plaintext}
.tge-ed code{padding:1px 5px}.tge-ed pre{padding:10px;margin:6px 0;overflow-x:auto}
.tge-ed table{display:block;max-width:100%;overflow-x:auto;border-collapse:collapse;margin:8px 0;white-space:normal}
.tge-ed td,.tge-ed th{border:1px solid var(--b);padding:6px 10px;min-width:64px;vertical-align:top}
.tge-ed th{background:var(--mut);font-weight:700}
.tge-foot{display:flex;justify-content:space-between;padding:5px 12px 6px;font-size:11px;opacity:.8;background:var(--mut);border-top:1px solid var(--b);border-radius:0 0 8px 8px}
.tge-foot .over{color:#d92d20;font-weight:700;opacity:1}
/* Scoped controls prevent dashboard form/table rules leaking into the editor. */
.product-editor-section{min-width:0;margin:0 0 20px;grid-column:1/-1}
.product-editor-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:10px}
.product-editor-heading h3{display:flex;align-items:center;gap:8px;font-size:14px;line-height:1.7;margin:0}
.product-editor-heading img{display:block;width:20px;height:20px;max-width:20px;object-fit:contain;flex:0 0 20px}
.product-editor-hint{font-size:12px;color:var(--muted,#657b74);line-height:1.8;margin:0 0 8px}
.product-editor-heading .product-editor-hint{margin:0}
.product-editor-heading .editor-copy-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;flex:0 0 auto;width:auto;min-width:0;min-height:36px;height:36px;padding:0 10px;margin:0;border:1px solid var(--line,#b8ccc5);border-radius:9px;background:transparent;color:inherit;font:inherit;font-size:12px;box-shadow:none;cursor:pointer}
.editor-copy-button svg{width:16px;height:16px;flex:none}
.tge{min-width:0;border-width:1px;border-color:var(--b);border-radius:14px;box-shadow:0 2px 8px #102b2010}
.tge .tge-bar{padding:8px;gap:4px;border-width:1px;min-height:54px}
.tge .tge-bar button{width:38px;min-width:38px;height:38px;min-height:38px;max-height:38px;padding:0;margin:0;flex:0 0 auto;box-shadow:none;line-height:1;border-radius:8px;transform:none}
.tge .tge-bar button svg{width:18px;height:18px;flex:none}
.tge .tge-bar .tge-preview-button{width:auto;padding:0 10px;gap:6px;margin-inline-start:auto;font-size:12px}
.tge .tge-tops button{width:auto;padding:0 8px;font-size:12px}
.tge .tge-ed{display:block;width:100%;min-width:0;min-height:220px;max-height:520px;padding:16px;line-height:1.95;font-size:14px;overflow:auto;resize:vertical}
.tge .tge-ed:empty:before{opacity:.65}
.tge .tge-foot{padding:8px 12px;border-radius:0;gap:8px;flex-wrap:wrap;font-size:11px;line-height:1.8;opacity:1;color:var(--fg)}
.tge .tge-pop{gap:8px}.tge .tge-pop[hidden],.tge .tge-tops[hidden]{display:none}
.tge .tge-pop label{display:flex;flex-direction:row;margin:0;width:auto;min-width:0}
.tge .tge-pop input[type=number]{width:64px;min-width:0}
.tge .tge-pop button{width:auto;min-width:0;min-height:36px;margin:0;box-shadow:none}
.tge .tge-ed table,.tge-preview-dialog .tge-ed table{display:table;width:auto;min-width:0;max-width:none;table-layout:auto;margin:10px 0;border-collapse:collapse;white-space:normal}
.tge .tge-ed td,.tge .tge-ed th,.tge-preview-dialog .tge-ed td,.tge-preview-dialog .tge-ed th{min-width:36px;width:auto;max-width:320px;padding:6px 10px;border:1px solid var(--b);direction:rtl;text-align:start;white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.8}
.tge .tge-ed th,.tge-preview-dialog .tge-ed th{background:var(--mut);color:var(--fg);font-weight:700}
.tge-preview-dialog{--b:#a5bcc5;--bg:#fff;--fg:#243e39;--mut:#f0f4f5;--ac:#087b70;width:min(600px,calc(100vw - 28px));max-width:calc(100vw - 28px);max-height:85dvh;margin:auto;padding:0;border:1px solid var(--b);border-radius:20px;background:var(--bg);color:var(--fg);box-shadow:0 24px 80px #0004;overflow:auto;font-family:inherit}
.tge-preview-dialog::backdrop{background:#10231ecc;backdrop-filter:blur(3px)}
.tge-preview-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 20px;border-bottom:1px solid var(--b)}
.tge-preview-header .tge-preview-close{display:grid;place-items:center;width:36px;min-width:36px;height:36px;min-height:36px;padding:0;margin:0;border:0;border-radius:50%;background:var(--mut);color:var(--fg);font-size:24px;box-shadow:none;cursor:pointer}
.tge-preview-dialog .tge-preview-body{min-height:160px;max-height:55dvh;margin:20px;padding:18px;border:1px solid var(--b);border-radius:14px;background:var(--bg);color:var(--fg);overflow:auto;white-space:pre-wrap;line-height:1.95}
.tge-preview-note{padding:0 20px 16px;margin:0;font-size:12px;opacity:.7;line-height:1.8}
.tge-preview-empty{opacity:.7}
html[data-dashboard-theme=dark] .tge-preview-dialog{--b:#49695e;--bg:#14271f;--fg:#e0eee8;--mut:#20392f;--ac:#7bd4be}
.tge button:focus-visible,.editor-copy-button:focus-visible,.tge-preview-close:focus-visible{outline:2px solid var(--ac,#087b70);outline-offset:2px}
@media(max-width:600px){.tge .tge-ed{min-height:200px;padding:12px}.tge .tge-bar{padding:6px}.tge .tge-bar button{width:36px;min-width:36px;min-height:36px;height:36px}.tge .tge-bar .tge-preview-button{width:auto}.tge-preview-dialog .tge-preview-body{margin:12px;padding:12px}.product-editor-heading{gap:8px}.product-editor-heading h3{font-size:13px}}
.catalog-editor-note{margin:8px 0;padding:10px 14px;border-radius:8px;border:1px solid var(--line);background:var(--surface);line-height:1.8}.catalog-stock-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-bottom:6px}.catalog-stock-label{margin:0;font-weight:700}.catalog-stock-count{font-size:12px;padding:2px 8px;border-radius:12px;background:var(--surface);border:1px solid var(--line)}.catalog-editor-help{margin-top:6px;line-height:1.7}
.product-editor-heading .editor-copy-button{width:120px;white-space:nowrap}.product-editor-heading .editor-copy-button span{font-size:12px;line-height:1.5;margin:0;padding:0}
.tge .tge-n{direction:ltr;unicode-bidi:isolate;font-variant-numeric:tabular-nums}
.tge .tge-ed pre,.tge-preview-dialog .tge-ed pre{display:table;width:auto;min-width:48px;max-width:100%;height:auto;min-height:0;max-height:280px;padding:8px 12px;margin:8px 0;white-space:pre;overflow:auto;box-sizing:border-box;color:var(--fg);background:var(--mut);line-height:1.7;text-align:start}
.tge .tge-pop{display:flex;align-items:center;justify-content:flex-start;gap:8px;flex-wrap:wrap;padding:10px}
.tge .tge-pop .tge-table-size{display:inline-flex;flex-direction:row;align-items:center;gap:6px;flex:0 0 auto;width:auto;margin:0;font-size:12px;line-height:1}
.tge .tge-pop input{height:36px;min-height:36px;margin:0;padding:0 8px;box-sizing:border-box}
.tge .tge-pop .tge-table-size input{width:56px;min-width:56px;max-width:56px}
.tge .tge-pop button{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-height:36px;height:36px;margin:0;padding:0 10px;line-height:1;font-size:12px}
.tge .tge-pop:has(.tge-table-size){display:grid;grid-template-columns:max-content max-content max-content max-content;align-items:center;justify-content:start}
@media(max-width:600px){.tge .tge-pop:has(.tge-table-size){grid-template-columns:repeat(2,minmax(0,1fr))}.tge .tge-pop .tge-table-size{justify-content:space-between}.tge .tge-pop:has(.tge-table-size) button{width:100%}}
