/* Status: PROTOTYPE (not production code) — DRAFT 2026-11-18. The look of emis-theme-studio.js (a slide-over drawer) on the theme tokens.
 * Decided (CR-657, 2026-11-18): GOV-R274-A shared controls; GOV-R279-A, GOV-R277-A theme builder, additive controls; GOV-R278-A organisation theme (Security follow-up SEC-R037). GOV-R313-A (CR-700): this comment closes here, so the first rule below applies. */
.ets-wrap { position: fixed; inset: 0; z-index: 150; }
.ets-back { position: absolute; inset: 0; background: rgb(15 23 42 / .35); animation: ets-fade .2s ease-out; }
.ets { position: absolute; inset-block: 0; inset-inline-end: 0; width: min(420px, 100vw); display: flex; flex-direction: column; background: rgb(var(--surface)); color: rgb(var(--ink));
  border-inline-start: 1px solid rgb(var(--border)); box-shadow: var(--float-3, 0 24px 48px -12px rgb(15 23 42 / .3)); animation: ets-in .25s cubic-bezier(.22, 1, .36, 1); }
html[dir="ltr"] .ets, .ets[dir="ltr"] { animation-name: ets-in-l; }
@keyframes ets-in { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes ets-in-l { from { transform: translateX(100%); } to { transform: none; } }
@keyframes ets-fade { from { opacity: 0; } }
.ets > header { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid rgb(var(--border)); }
.ets-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-ctl, 10px); background: linear-gradient(135deg, rgb(var(--brand-500)), rgb(var(--brand-700))); color: #fff; box-shadow: 0 6px 14px -6px rgb(var(--brand-600) / .6); }
.ets h3 { margin: 0; font-size: 16px; font-weight: 700; } .ets header > div { flex: 1; }
.ets-state { font-size: 12px; color: rgb(var(--ok, 5 150 105)); } .ets-state.dirty { color: rgb(var(--warn, 217 119 6)); }
.ets-state::before { content: '●'; margin-inline-end: 5px; font-size: 9px; }
.ets-x { width: 34px; height: 34px; border: 0; border-radius: 999px; background: transparent; color: rgb(var(--ink-muted)); cursor: pointer; transition: background .15s, transform .2s, color .15s; }
.ets-x:hover { background: rgb(var(--brand-50)); color: rgb(var(--brand-700)); transform: rotate(90deg); }
.ets-body { flex: 1; overflow-y: auto; padding: 6px 18px 18px; }
.ets-body section { padding: 14px 0; border-bottom: 1px solid rgb(var(--border)); } .ets-body section:last-child { border-bottom: 0; }
.ets-body h4 { display: flex; align-items: center; justify-content: space-between; margin: 0 0 10px; font-size: 13px; font-weight: 600; color: rgb(var(--ink-2)); }
.ets-val { padding: 1px 8px; border-radius: 6px; font: 600 11px/1.6 ui-monospace, monospace; color: rgb(var(--brand-700)); background: rgb(var(--brand-50)); border: 1px solid rgb(var(--brand-200)); }
/* ready looks */
.ets-looks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ets-look { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 10px; text-align: start; border: 1px solid rgb(var(--border)); border-radius: 12px; background: rgb(var(--surface)); color: inherit; font: inherit; cursor: pointer;
  transition: border-color .18s, transform .18s, box-shadow .18s; }
.ets-look:hover { transform: translateY(-2px); border-color: var(--lk); box-shadow: 0 8px 18px -12px var(--lk); }
.ets-look[aria-pressed="true"] { border-color: var(--lk); box-shadow: 0 0 0 2px var(--lk); }
.ets-look b { font-size: 13px; } .ets-look small { font-size: 11px; color: rgb(var(--ink-muted)); }
.ets-mini { display: grid; grid-template-columns: 1fr 2fr; grid-template-rows: 1fr 1fr; gap: 4px; width: 100%; height: 46px; margin-bottom: 4px; padding: 5px; border-radius: 8px; background: rgb(241 245 249); }
.ets-mini.dk { background: rgb(15 23 42); }
.ets-mini i { border-radius: var(--lr); background: #fff; border: 1px solid rgb(226 232 240); } .ets-mini.dk i { background: rgb(30 41 59); border-color: rgb(51 65 85); }
.ets-mini i:first-child { grid-row: span 2; background: var(--lk); border: 0; opacity: .9; }
/* colours */
/* «لوحة الألوان»: the theme panel's tiles (emis-theme.css .emis-theme-swatches): each module palette is a gradient of its own colours */
.ets-colors { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; padding: 5px 1px; }
.ets-sw { position: relative; flex: none; width: 27px; height: 27px; font-size: 11px; display: grid; place-items: center; border-radius: 999px; border: 0; background: var(--grad-brand); color: #fff; font-size: 13px; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .18); transition: transform .18s cubic-bezier(.22, 1, .36, 1), box-shadow .18s, border-color .15s; }
.ets-sw:hover { transform: translateY(-2px) scale(1.06); box-shadow: 0 8px 16px -8px rgb(var(--brand-600) / .7), inset 0 0 0 1px rgb(255 255 255 / .25); }
.ets-sw[aria-pressed="true"] { box-shadow: 0 0 0 2px rgb(var(--surface)), 0 0 0 4px rgb(var(--ink)); }
.ets-sw i { pointer-events: none; text-shadow: 0 1px 2px rgb(0 0 0 / .3); } .ets-sw .ck { display: none; }
.ets-sw[aria-pressed="true"] .ck { display: inline; } .ets-sw[aria-pressed="true"] .df { display: none; }
.ets-own { position: relative; flex: none; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 999px; border: 2px dashed rgb(var(--border-strong, var(--border))); background: rgb(var(--surface-2)); color: rgb(var(--ink-2, var(--ink))); cursor: pointer; transition: border-color .15s, color .15s, transform .18s; }
.ets-own:hover { border-color: rgb(var(--brand-500)); color: rgb(var(--brand-700)); transform: translateY(-2px); } .ets-own i { font-size: 13px; pointer-events: none; }
.ets-own input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ets-cfoot { display: flex; align-items: center; gap: 8px; margin-top: 8px; } .ets-cfoot small { font-size: 12px; color: rgb(var(--ink-muted)); }
.ets-hex { width: 92px; height: 32px; margin-inline-start: auto; padding: 0 10px; border: 1px solid rgb(var(--border-strong)); border-radius: 8px; background: rgb(var(--surface)); color: rgb(var(--ink));
  font: 600 12px ui-monospace, monospace; text-transform: uppercase; direction: ltr; text-align: center; }
.ets-hex.bad { border-color: rgb(var(--bad, 225 29 72)) !important; }
/* segmented */
.ets-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; padding: 3px; border: 1px solid rgb(var(--border)); border-radius: calc(var(--r-ctl, 10px) + 2px); background: rgb(var(--surface-2) / .7); }
.ets-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; border: 0; border-radius: var(--r-ctl, 10px); background: transparent; color: rgb(var(--ink-2)); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.ets-seg button i { font-size: 11px; opacity: .7; }
.ets-seg button:hover { color: rgb(var(--brand-700)); background: rgb(var(--surface)); }
.ets-seg button[aria-checked="true"] { background: linear-gradient(135deg, rgb(var(--brand-500)), rgb(var(--brand-700))); color: #fff; box-shadow: 0 4px 12px -6px rgb(var(--brand-600) / .7); }
.ets-seg button[aria-checked="true"] i { opacity: 1; }
/* radius */
.ets-rad { display: flex; align-items: center; gap: 12px; }
.ets-rad input[type="range"] { flex: 1; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 999px; background: linear-gradient(90deg, rgb(var(--brand-300)), rgb(var(--brand-600))); cursor: pointer; }
.ets-rad input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 999px; background: #fff; box-shadow: 0 0 0 2px rgb(var(--brand-600)), 0 1px 4px rgb(15 23 42 / .3); transition: transform .15s; }
.ets-rad input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.15); }
.ets-rr { display: flex; gap: 6px; } .ets-rr i { width: 20px; height: 20px; border: 2px solid rgb(var(--brand-400)); border-inline-end: 0; border-block-end: 0; }
/* preview */
.ets-prev { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid rgb(var(--border)); border-radius: var(--r-card, 16px); background: rgb(var(--canvas)); }
.ets-pc { display: flex; align-items: center; justify-content: space-between; }
.ets-bd { padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; color: rgb(180 83 9); background: rgb(255 251 235); border: 1px solid rgb(253 230 138); }
.ets-pf { display: flex; align-items: center; justify-content: space-between; height: 36px; padding: 0 12px; border: 1px solid rgb(var(--brand-400)); border-radius: var(--r-ctl, 10px); background: rgb(var(--surface)); box-shadow: 0 0 0 3px rgb(var(--brand-500) / .15); font-size: 12px; }
.ets-pf span { color: rgb(var(--ink-muted)); } .ets-pf i { font-style: normal; font-weight: 700; direction: ltr; }
.ets-pr { display: flex; justify-content: space-between; align-items: center; height: calc(var(--row-h, 44px) * .8); padding: 0 10px; border-bottom: 1px solid rgb(var(--border)); font-size: 12px; transition: height .2s; }
.ets-pr span:first-child { font-family: ui-monospace, monospace; color: rgb(var(--brand-700)); }
.ets-pb { height: 36px; border: 0; border-radius: var(--r-ctl, 10px); background: rgb(var(--brand-600)); color: #fff; font: inherit; font-size: 12.5px; font-weight: 700; }
/* footer */
.ets > footer { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid rgb(var(--border)); background: rgb(var(--surface-2) / .5); }
.ets > footer span { flex: 1; }
.ets > footer button { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border: 1px solid rgb(var(--border-strong)); border-radius: var(--r-ctl, 10px); background: rgb(var(--surface)); color: rgb(var(--ink-2)); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: transform .15s, border-color .15s, background .15s, color .15s; }
.ets > footer button:hover:not(:disabled) { transform: translateY(-1px); border-color: rgb(var(--brand-400)); color: rgb(var(--brand-700)); }
.ets > footer .ets-save { background: rgb(var(--brand-600)); border-color: rgb(var(--brand-600)); color: #fff; }
.ets > footer .ets-save:hover:not(:disabled) { background: rgb(var(--brand-700)); color: #fff; }
.ets > footer .ets-save:disabled { opacity: .45; cursor: default; }
.ets button:focus-visible, .ets input:focus-visible { outline: 2px solid rgb(var(--brand-600)); outline-offset: 2px; }
.dark .ets-bd { color: rgb(252 211 77); background: rgb(245 158 11 / .14); border-color: rgb(245 158 11 / .35); }
@media (prefers-reduced-motion: reduce) { .ets, .ets-back { animation: none; } .ets-look:hover, .ets-sw:hover, .ets-own:hover { transform: none; } }
/* the studio drives every shared control through the tokens */
html[data-radius] :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"], [type="hidden"]), select, textarea, .emsel-field, .ep-in) { border-radius: var(--r-ctl) !important; }   /* only when the theme sets one radius */
/* the three tabs, and the hint line under a setting title */
.ets-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 12px 18px 0; padding: 4px; border: 1px solid rgb(var(--border)); border-radius: 12px; background: rgb(var(--surface-2) / .7); }
.ets-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 6px; border: 0; border-radius: 9px; background: transparent; color: rgb(var(--ink-2));
  font: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.ets-tabs button i { font-size: 12px; opacity: .75; }
.ets-tabs button:hover { color: rgb(var(--brand-700)); background: rgb(var(--surface)); }
.ets-tabs button[aria-selected="true"] { background: rgb(var(--surface)); color: rgb(var(--brand-700)); box-shadow: 0 1px 2px rgb(15 23 42 / .1), 0 0 0 1px rgb(var(--brand-200)); }
.ets-tabs button[aria-selected="true"] i { opacity: 1; color: rgb(var(--brand-600)); }
.ets-hint { margin: -6px 0 10px; font-size: 11.5px; color: rgb(var(--ink-muted)); }
.ets-seg button { white-space: nowrap; padding: 0 6px; }
/* fonts: the chosen face reaches every element except icons and code (Font Awesome keeps its own font) */
/* CR-726 / GOV-R337-A */
/* two fonts: an Arabic page (any dir but ltr) takes the Arabic font, an English page (dir=ltr) the English one; a direction with no font chosen keeps the page's own */
html[data-font-ar]:not([dir="ltr"]) { --emis-font: var(--emis-font-ar); }
html[data-font-en][dir="ltr"] { --emis-font: var(--emis-font-en); }
html[data-font][data-font-ar]:not([dir="ltr"]) body, html[data-font][data-font-ar]:not([dir="ltr"]) body *:not(i):not(.fa):not([class*="fa-"]):not(code):not(pre):not(kbd):not(samp):not(.ets-fs):not(.ets-fs *),
html[data-font][data-font-en][dir="ltr"] body, html[data-font][data-font-en][dir="ltr"] body *:not(i):not(.fa):not([class*="fa-"]):not(code):not(pre):not(kbd):not(samp):not(.ets-fs):not(.ets-fs *) { font-family: var(--emis-font) !important; }
.ets-fsel { width: 100%; height: 40px; padding: 0 12px; border: 1px solid rgb(var(--border)); border-radius: var(--r-ctl, 10px); background: rgb(var(--surface)); color: rgb(var(--ink)); font: inherit; font-size: 13.5px; cursor: pointer; }
.ets-fsel:focus { outline: none; border-color: rgb(var(--brand-600)); box-shadow: 0 0 0 3px rgb(var(--brand-600) / .18); }
.ets-fprev { margin-top: 8px; padding: 12px 14px; border: 1px dashed rgb(var(--brand-300)); border-radius: 12px; background: rgb(var(--brand-50) / .45); animation: ets-fin .25s ease-out; }
.dark .ets-fprev { background: rgb(var(--brand-600) / .08); }
.ets-fprev .ets-fs { display: flex; flex-direction: column; gap: 3px; } .ets-fprev b { font-size: 16px; color: rgb(var(--ink)); } .ets-fprev .ets-fs > span { font-size: 13.5px; color: rgb(var(--ink)); } .ets-fprev .ets-fen { color: rgb(var(--ink-muted)) !important; font-size: 12.5px !important; }
.ets-fprev small { display: block; margin-top: 6px; font-size: 11px; color: rgb(var(--brand-700)); font-weight: 600; } .dark .ets-fprev small { color: rgb(var(--brand-300)); }
@keyframes ets-fin { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
/* my themes: saved looks sit with the ready ones; add card, naming row, delete with a styled confirm */
.ets-mine-card { position: relative; display: flex; } .ets-mine-card > .ets-look { flex: 1; min-width: 0; }
.ets-mdel { position: absolute; top: 6px; inset-inline-end: 6px; width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 999px; background: rgb(var(--surface)); color: rgb(var(--ink-muted)); box-shadow: 0 1px 3px rgb(15 23 42 / .15); cursor: pointer; opacity: 0; transition: opacity .15s, background .15s, color .15s; }
.ets-mine-card:hover .ets-mdel, .ets-mdel:focus-visible { opacity: 1; } .ets-mdel:hover { background: rgb(225 29 72); color: #fff; }
@media (hover: none) { .ets-mdel { opacity: 1; } }
.ets-add { align-items: center; justify-content: center; text-align: center; min-height: 118px; border-style: dashed; border-width: 1.5px; --lk: rgb(var(--brand-600)); color: rgb(var(--brand-700)); }
.ets-add > i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 999px; background: rgb(var(--brand-50)); font-size: 14px; margin-bottom: 4px; transition: transform .2s; }
.ets-add:hover > i { transform: rotate(90deg); }
.dark .ets-add { color: rgb(var(--brand-300)); } .dark .ets-add > i { background: rgb(var(--brand-600) / .2); }
.ets-name, .ets-del { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid rgb(var(--brand-300)); border-radius: 12px; background: rgb(var(--brand-50) / .5); }
.ets-del { grid-column: auto; border-color: rgb(225 29 72 / .4); background: rgb(225 29 72 / .05); cursor: default; }
.dark .ets-name { background: rgb(var(--brand-600) / .08); }
.ets-name label { font-size: 12px; font-weight: 700; color: rgb(var(--ink)); }
.ets-nm { height: 38px; padding: 0 12px; border: 1px solid rgb(var(--border)); border-radius: var(--r-ctl, 10px); background: rgb(var(--surface)); color: rgb(var(--ink)); font: inherit; font-size: 13px; }
.ets-nm:focus { outline: none; border-color: rgb(var(--brand-600)); box-shadow: 0 0 0 3px rgb(var(--brand-600) / .18); }
.ets-nm[aria-invalid="true"] { border-color: rgb(225 29 72); }
.ets-err { margin: 0; font-size: 12px; color: rgb(225 29 72); }
.ets-delb { display: flex; gap: 6px; margin-top: 2px; }
.ets-yes, .ets-no { height: 32px; padding: 0 12px; border-radius: 8px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: background .15s, transform .15s; }
.ets-yes { border: 0; background: rgb(var(--brand-600)); color: #fff; } .ets-yes:hover { background: rgb(var(--brand-700)); transform: translateY(-1px); }
.ets-del .ets-yes { background: rgb(225 29 72); } .ets-del .ets-yes:hover { background: rgb(190 18 60); }
.ets-no { border: 1px solid rgb(var(--border)); background: rgb(var(--surface)); color: rgb(var(--ink)); } .ets-no:hover { background: rgb(var(--surface-2)); }
/* the Payroll looks: the mini preview shows the gradient top bar and the dark side menu of the Payroll screens */
.ets-mini.pay { grid-template-columns: 10px 1fr 2fr; grid-template-rows: 7px 1fr 1fr; gap: 3px; }
.ets-mini.pay em { grid-column: 1 / -1; border-radius: 3px; background: var(--grad-brand); }
.ets-mini.pay u { grid-row: 2 / span 2; border-radius: 3px; background: rgb(15 23 42); } .ets-mini.pay.dk u { background: rgb(2 6 23); box-shadow: inset 0 0 0 1px rgb(51 65 85); }
.ets-mini.pay i:first-of-type { grid-row: span 2; background: var(--lk); border: 0; opacity: .9; }
/* the three-colour gradient builder: a folded row under the palette; open, a bar preview, three pickers, ready blends */
.ets-grad { margin-top: 10px; border: 1px solid rgb(var(--border)); border-radius: 12px; background: rgb(var(--surface)); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.ets-grad:hover { border-color: rgb(var(--brand-300)); } .ets-grad.open { padding-bottom: 12px; box-shadow: 0 8px 20px -14px rgb(15 23 42 / .35); }
.ets-gtog { display: flex; align-items: center; gap: 10px; width: 100%; height: 44px; padding: 0 12px; border: 0; background: transparent; color: rgb(var(--ink)); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; text-align: start; }
.ets-gtog > i { margin-inline-start: auto; font-size: 11px; color: rgb(var(--ink-muted)); transition: transform .2s; } .ets-gtog[aria-expanded="true"] > i { transform: rotate(180deg); }
.ets-gtog em { font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgb(5 150 105 / .12); color: rgb(4 120 87); }
.ets-gdot { width: 22px; height: 22px; border-radius: 999px; flex: none; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .25); }
.ets-gbar { margin: 0 12px; height: 54px; border-radius: 10px; display: flex; flex-direction: column; justify-content: center; padding: 0 14px; color: #fff; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .15); transition: background .2s; }
.ets-gbar b { font-size: 13px; text-shadow: 0 1px 2px rgb(0 0 0 / .25); } .ets-gbar span { font: 600 11px ui-monospace, monospace; opacity: .9; direction: ltr; text-align: end; }
.ets-gpicks { display: flex; align-items: flex-start; justify-content: center; gap: 8px; margin: 12px 12px 4px; }
.ets-gpick { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; } .ets-gpick small { font-size: 11px; color: rgb(var(--ink-muted)); }
.ets-gc { position: relative; width: 38px; height: 38px; border-radius: 999px; box-shadow: 0 0 0 2px rgb(var(--surface)), 0 0 0 3px rgb(var(--border-strong, var(--border))); transition: transform .15s; }
.ets-gpick:hover .ets-gc { transform: scale(1.08); } .ets-gc input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ets-garr { margin-top: 13px; font-size: 11px; color: rgb(var(--ink-muted)); } html[dir="ltr"] .ets-garr { transform: scaleX(-1); }
.ets-gswap { margin-top: 5px; margin-inline-start: 4px; width: 30px; height: 30px; border-radius: 999px; border: 1px solid rgb(var(--border)); background: rgb(var(--surface)); color: rgb(var(--ink-muted)); cursor: pointer; transition: color .15s, border-color .15s, transform .2s; }
.ets-gswap:hover { color: rgb(var(--brand-700)); border-color: rgb(var(--brand-300)); transform: rotate(180deg); }
.ets-grad .ets-hint { margin: 10px 12px 6px; }
.ets-blends { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 12px; }
.ets-blend { height: 34px; border: 2px solid transparent; border-radius: 9px; color: #fff; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; text-shadow: 0 1px 2px rgb(0 0 0 / .3); transition: transform .15s, box-shadow .15s; }
.ets-blend:hover { transform: translateY(-1px); box-shadow: 0 6px 12px -6px rgb(15 23 42 / .5); } .ets-blend[aria-pressed="true"] { border-color: rgb(var(--ink)); }
.ets-grad > .ets-yes, .ets-grad > .ets-no { margin: 4px 12px 0; display: inline-flex; align-items: center; gap: 6px; }
/* ---- the theme builder (EmisStudio.build): a full screen, the controls on one side and a live preview on the other */
.ets.etb { inset: clamp(0px, 3vw, 28px); width: auto; max-width: 1320px; margin-inline: auto; border: 1px solid rgb(var(--border)); border-radius: 18px; overflow: hidden; animation: etb-in .28s cubic-bezier(.22, 1, .36, 1); }
@keyframes etb-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.etb > header { gap: 14px; } .etb > header > div { flex: 0 1 auto; margin-inline-end: auto; }
.etb-namef { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: rgb(var(--ink-muted)); }
.etb-name { width: min(260px, 40vw); height: 38px; padding: 0 12px; border: 1px solid rgb(var(--border)); border-radius: var(--r-ctl, 10px); background: rgb(var(--surface)); color: rgb(var(--ink)); font: inherit; font-size: 13px; }
.etb-name:focus { outline: none; border-color: rgb(var(--brand-600)); box-shadow: 0 0 0 3px rgb(var(--brand-600) / .18); } .etb-name[aria-invalid="true"] { border-color: rgb(var(--bad, 225 29 72)); }
.etb-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(340px, 400px) 1fr; }
.etb-side { display: flex; flex-direction: column; min-height: 0; border-inline-end: 1px solid rgb(var(--border)); }
.etb-tabs { overflow-x: auto; scrollbar-width: none; } .etb-tabs button { white-space: nowrap; }
.etb-err { margin: 0; font-size: 12px; color: rgb(var(--bad, 225 29 72)); }
.etb-keep { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border: 1px solid rgb(var(--brand-300)); border-radius: 10px; background: rgb(var(--brand-50)); color: rgb(var(--brand-700)); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .15s, transform .15s; }
.etb-keep:hover { background: rgb(var(--brand-100)); transform: translateY(-1px); } .dark .etb-keep { background: rgb(var(--brand-600) / .15); color: rgb(var(--brand-300)); }
.etb-swatches { display: flex; gap: 4px; margin: -4px 0 6px; } .etb-swatches i { flex: 1; height: 10px; border-radius: 3px; }
/* the preview: real classes (.card, .card-h, .card-b, .kpi) so the card settings of the theme reach it as they reach a module */
.etb-prev { min-height: 0; overflow-y: auto; padding: 18px 22px 26px; background: rgb(var(--canvas, var(--surface-2))); display: flex; flex-direction: column; gap: 14px; }
.etb-ptitle { font-size: 11px; font-weight: 700; letter-spacing: .04em; color: rgb(var(--ink-muted)); text-transform: uppercase; }
.etb-prev .card { background: rgb(var(--surface)); border: 1px solid rgb(var(--border)); border-radius: var(--r-card, 16px); transition: box-shadow .2s, transform .2s, border-color .2s; }
.etb-prev .card-h { display: flex; align-items: center; gap: 8px; padding: 14px 16px 0; } .etb-prev .card-h h3 { margin: 0; font-size: 13.5px; font-weight: 600; }
.etb-prev .card-b { padding: 10px 16px 16px; }
.etb-band { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-radius: var(--r-card, 16px); background: var(--grad-hero, var(--grad-brand)); color: #fff; box-shadow: 0 10px 24px -14px rgb(var(--brand-700) / .8); }
.etb-band b { display: block; font-size: 17px; } .etb-band small { opacity: .85; font-size: 12px; }
.etb-chip { padding: 4px 10px; border-radius: 999px; background: rgb(255 255 255 / .18); border: 1px solid rgb(255 255 255 / .3); font: 700 11px ui-monospace, monospace; }
.etb-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.etb-kic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgb(var(--brand-50)); color: rgb(var(--brand-700)); font-size: 13px; } .dark .etb-kic { background: rgb(var(--brand-600) / .18); color: rgb(var(--brand-300)); }
.etb-kpi .card-b { display: flex; align-items: baseline; gap: 10px; } .etb-kpi .kpi-v { font-size: 24px; font-weight: 700; color: rgb(var(--ink)); font-variant-numeric: tabular-nums; }
.etb-delta { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; } .etb-delta.up { color: rgb(var(--ok, 5 150 105)); background: rgb(var(--ok, 5 150 105) / .1); } .etb-delta.down { color: rgb(var(--bad, 225 29 72)); background: rgb(var(--bad, 225 29 72) / .1); }
.etb-charts { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; } .etb-cv { position: relative; height: 200px; }
.etb-rows > div { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 10px; min-height: var(--row-h, 44px); border-bottom: 1px solid rgb(var(--border)); font-size: 13px; }
.etb-rows > div span:first-child { font: 600 12px ui-monospace, monospace; color: rgb(var(--brand-700)); } .dark .etb-rows > div span:first-child { color: rgb(var(--brand-300)); }
.etb-badge { padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; } .etb-badge.pend { background: rgb(var(--warn, 217 119 6) / .12); color: rgb(var(--warn, 217 119 6)); }
.etb-badge.ok { background: rgb(var(--ok, 5 150 105) / .12); color: rgb(var(--ok, 5 150 105)); } .etb-badge.draft { background: rgb(var(--surface-2)); color: rgb(var(--ink-muted)); }
.etb-btns { display: flex; gap: 8px; margin-top: 12px; } .etb-btns button { height: 38px; padding: 0 16px; border-radius: var(--r-ctl, 10px); font: inherit; font-size: 13px; font-weight: 700; cursor: default; }
.etb-b1 { border: 0; background: rgb(var(--brand-600)); color: #fff; } .etb-b2 { border: 1px solid rgb(var(--border)); background: rgb(var(--surface)); color: rgb(var(--ink)); }
/* CR-724, GOV-R348-A */
/* the sample's notice, tabs and pagination, drawn as a module draws them; the builder settings tabLook, alertLook and pagerLook act on them */
.etb-notice { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; padding: 8px 12px; border: 1px solid rgb(var(--info) / .3); border-radius: var(--r-ctl, 10px); background: rgb(var(--info) / .08); color: rgb(var(--info)); font-size: 12.5px; font-weight: 600; }
.dark .etb-notice { color: color-mix(in srgb, rgb(var(--info)) 55%, rgb(var(--ink))); }
.etb-stabs { display: flex; gap: 4px; margin-bottom: 10px; border-bottom: 1px solid rgb(var(--border)); }
.etb-stabs [role="tab"] { height: 32px; padding: 0 12px; border: 1px solid transparent; border-radius: var(--r-ctl, 10px) var(--r-ctl, 10px) 0 0; background: transparent; color: rgb(var(--ink-muted)); font: inherit; font-size: 12.5px; font-weight: 600; cursor: default; }
.etb-stabs [role="tab"][aria-selected="true"] { border-color: rgb(var(--border)); border-bottom-color: rgb(var(--surface)); margin-bottom: -1px; background: rgb(var(--surface)); color: rgb(var(--ink)); }
.etb-pager { display: flex; gap: 4px; align-items: center; justify-content: flex-end; margin-top: 10px; }
.etb-pager button { min-width: 30px; height: 30px; padding: 0 6px; border: 1px solid rgb(var(--border)); border-radius: var(--r-ctl, 10px); background: rgb(var(--surface)); color: rgb(var(--ink-2)); font: inherit; font-size: 12px; font-variant-numeric: tabular-nums; cursor: default; }
.etb-pager button.on { background: rgb(var(--brand-600)); border-color: rgb(var(--brand-600)); color: rgb(var(--on-brand)); }
/* the studio's way into the builder */
.etb-cta { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center; width: 100%; margin: 12px 0 4px; padding: 12px 14px; text-align: start; border: 1px solid rgb(var(--brand-200)); border-radius: 14px;
  background: linear-gradient(135deg, rgb(var(--brand-50)), rgb(var(--surface))); color: rgb(var(--ink)); font: inherit; cursor: pointer; transition: transform .18s, box-shadow .18s, border-color .15s; }
.etb-cta:hover { transform: translateY(-2px); border-color: rgb(var(--brand-400)); box-shadow: 0 10px 22px -14px rgb(var(--brand-600) / .7); }
.etb-cta > span { grid-row: span 2; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--grad-brand); color: #fff; font-size: 17px; }
.etb-cta b { font-size: 14px; } .etb-cta small { grid-column: 2; font-size: 11.5px; color: rgb(var(--ink-muted)); line-height: 1.5; }
.etb-go { grid-row: 1 / span 2; grid-column: 3; color: rgb(var(--brand-600)); transition: transform .2s; } .etb-cta:hover .etb-go { transform: translateX(-4px); } html[dir="ltr"] .etb-go { transform: scaleX(-1); }
.dark .etb-cta { background: linear-gradient(135deg, rgb(var(--brand-600) / .14), rgb(var(--surface))); border-color: rgb(var(--brand-600) / .35); }
.ets-medit { inset-inline-end: 34px; } .ets-medit:hover { background: rgb(var(--brand-600)) !important; color: #fff !important; }
html[dir="ltr"] .ets.etb, .ets.etb[dir="ltr"] { animation-name: etb-in; }
/* the live screen of the builder: a picker of the module prototypes and a screen code, then the screen itself in a frame */
.etb-pbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; } .etb-pbar .etb-ptitle { margin-inline-end: auto; }
.etb-onf { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: rgb(var(--ink-muted)); } .etb-onf[hidden] { display: none; }
.etb-on, .etb-scr { height: 34px; padding: 0 10px; border: 1px solid rgb(var(--border)); border-radius: var(--r-ctl, 10px); background: rgb(var(--surface)); color: rgb(var(--ink)); font: inherit; font-size: 12.5px; }
.etb-on { min-width: 170px; cursor: pointer; } .etb-scr { width: 110px; font-family: ui-monospace, monospace; }
.etb-on:focus, .etb-scr:focus { outline: none; border-color: rgb(var(--brand-600)); box-shadow: 0 0 0 3px rgb(var(--brand-600) / .18); }
.etb-scrgo { height: 34px; padding: 0 12px; border: 0; border-radius: var(--r-ctl, 10px); background: rgb(var(--brand-600)); color: #fff; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: background .15s; }
.etb-scrgo:hover { background: rgb(var(--brand-700)); }
.etb-live { flex: 1; display: flex; flex-direction: column; gap: 6px; min-height: 520px; } .etb-live[hidden], .etb-sample[hidden] { display: none; }
.etb-frame { flex: 1; width: 100%; min-height: 520px; border: 1px solid rgb(var(--border)); border-radius: 12px; background: rgb(var(--surface)); box-shadow: 0 10px 30px -18px rgb(15 23 42 / .45); }
.etb-sample { display: flex; flex-direction: column; gap: 14px; }
/* the mock shell of the sample preview: a side menu and a top bar that follow the theme's bars (data-side-look, data-bar, data-band, data-head) */
.etb-app { display: grid; grid-template-columns: 56px minmax(0, 1fr); border: 1px solid rgb(var(--border)); border-radius: 14px; overflow: hidden; background: rgb(var(--canvas, var(--surface-2))); }
.etb-pside { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0; background: rgb(15 23 42); color: rgb(255 255 255 / .55); transition: background .25s, color .25s; }
.etb-pside b { display: grid; place-items: center; width: 32px; height: 32px; margin-bottom: 8px; border-radius: 9px; background: var(--grad-brand); color: #fff; font-size: 13px; }
.etb-pside i { display: grid; place-items: center; width: 36px; height: 34px; border-radius: 9px; font-size: 14px; } .etb-pside i.on { background: rgb(var(--brand-600)); color: #fff; }
html[data-side-look="light"] .etb-pside { background: rgb(var(--surface)); color: rgb(var(--ink-muted)); border-inline-end: 1px solid rgb(var(--border)); }
html[data-side-look="light"] .etb-pside i.on { background: rgb(var(--brand-50)); color: rgb(var(--brand-700)); }
html[data-side-look="brand"] .etb-pside { background: var(--grad-brand); color: rgb(255 255 255 / .7); } html[data-side-look="brand"] .etb-pside i.on { background: rgb(255 255 255 / .2); }
.etb-pmain { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 0 14px 16px; }
.etb-ptop { display: flex; align-items: center; gap: 12px; height: 48px; margin: 0 -14px; padding: 0 14px; color: #fff; font-size: 13px; font-weight: 700;
  background: linear-gradient(135deg, rgb(var(--brand-600)) 0%, rgb(var(--brand-700)) 55%, rgb(var(--brand-900)) 100%); transition: height .25s, background .25s; }
.etb-ptop em { flex: 1; max-width: 260px; margin-inline: auto; padding: 5px 12px; border-radius: 999px; background: rgb(255 255 255 / .15); font-style: normal; font-weight: 500; font-size: 12px; opacity: .9; }
html[data-bar="s"] .etb-ptop { height: 40px; } html[data-bar="l"] .etb-ptop { height: 58px; } .dark .etb-ptop { background: linear-gradient(135deg, rgb(30 41 59), rgb(15 23 42)); }
.etb-band { transition: padding .25s, background .25s, color .25s; } html[data-band="m"] .etb-band { padding: 22px 22px; } html[data-band="l"] .etb-band { padding: 32px 26px; } html[data-band="l"] .etb-band b { font-size: 21px; }
html[data-head="calm"] .etb-band { background: rgb(var(--surface)); color: rgb(var(--ink)); border: 1px solid rgb(var(--border)); box-shadow: none; }
html[data-head="calm"] .etb-chip { background: rgb(var(--brand-50)); color: rgb(var(--brand-700)); border-color: rgb(var(--brand-200)); } html[data-head="calm"] .etb-band small { color: rgb(var(--ink-muted)); opacity: 1; }
/* the live simulation: the part a control changes is outlined, the rest of the sample dims, a change pulses once */
.etb-spot { outline: 2px dashed rgb(var(--brand-500)) !important; outline-offset: 3px; transition: opacity .2s, filter .2s; }   /* the outline only: it never moves what it marks */
.etb-spotting .etb-pmain > *:not(.etb-spot):not(:has(.etb-spot)), .etb-spotting .etb-app > .etb-pside:not(.etb-spot), .etb-spotting .etb-kpis > :not(.etb-spot):not(:has(.etb-spot)), .etb-spotting .etb-charts > :not(.etb-spot):not(:has(.etb-spot)) { opacity: .32; filter: saturate(.6); }
.etb-sample * { transition: opacity .2s, filter .2s; }
.etb-pulse { animation: etb-pulse .9s ease-out; }
@keyframes etb-pulse { 0% { box-shadow: 0 0 0 0 rgb(var(--brand-500) / .55); } 100% { box-shadow: 0 0 0 16px rgb(var(--brand-500) / 0); } }
@media (prefers-reduced-motion: reduce) { .etb-pulse { animation: none; } }
/* the side menu of the sample: labels when shown, icons only when folded, gone when hidden (data-nav), and the colour squares of the look row */
.etb-app { grid-template-columns: 150px minmax(0, 1fr); transition: grid-template-columns .25s; }
html[data-nav="rail"] .etb-app { grid-template-columns: 56px minmax(0, 1fr); } html[data-nav="hidden"] .etb-app { grid-template-columns: 0 minmax(0, 1fr); }
html[data-nav="hidden"] .etb-pside { visibility: hidden; padding: 0; }
.etb-pside { align-items: stretch; padding: 12px 8px; overflow: hidden; } .etb-pside b { align-self: center; }
.etb-pi { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px; border-radius: 9px; font-size: 12px; white-space: nowrap; }
.etb-pi i { width: auto; height: auto; font-size: 13px; } .etb-pi em { font-style: normal; }
html[data-nav="rail"] .etb-pi { justify-content: center; padding: 0; } html[data-nav="rail"] .etb-pi em { display: none; }
.etb-pi.on { background: rgb(var(--brand-600)); color: #fff; }
html[data-side-look="light"] .etb-pi.on { background: rgb(var(--brand-50)); color: rgb(var(--brand-700)); } html[data-side-look="brand"] .etb-pi.on { background: rgb(255 255 255 / .2); }
.etb-sq { display: inline-block; width: 16px; height: 16px; border-radius: 5px; border: 1px solid rgb(var(--border-strong)); flex: none; }
.etb-sq-light { background: rgb(var(--surface)); } .etb-sq-brand { background: var(--grad-brand); border-color: transparent; } .etb-sq-dark { background: rgb(15 23 42); border-color: rgb(51 65 85); }
/* the builder on its own browser page (emis-theme-builder.html): the whole window, no backdrop, no entrance animation */
.etb-page .ets-back { display: none; }
.etb-page .ets.etb { inset: 0; max-width: none; border: 0; border-radius: 0; box-shadow: none; animation: none; }
.etb-page .etb-live, .etb-page .etb-frame { min-height: calc(100vh - 230px); }
/* SEC-R050-A (CR-685): hosted inside SCR-SEC-B10 (?embed=1): no close button of its own; the Security shell around the frame is the way back */
.etb-embed .ets-x { display: none; }
/* phase one in the preview: the form and the table (a module-like default look; the theme's data-btn*, data-input*, data-t-* rules then apply) */
.etb-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 12px; }
.etb-form label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-size: 12px; font-weight: 600; color: rgb(var(--ink-2)); }
.etb-form :is(input, select) { height: var(--control-h, 40px); padding: 0 12px; border: 1px solid rgb(var(--border)); border-radius: var(--r-ctl, 10px); background: rgb(var(--surface)); color: rgb(var(--ink)); font: inherit; font-size: 13px; }
.etb-form .etb-btns { margin-top: 4px; }
.etb-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.etb-tbl th { height: 38px; padding: 0 10px; text-align: start; font-size: 11.5px; font-weight: 700; color: rgb(var(--ink-muted)); background: rgb(var(--surface-2)); border-bottom: 1px solid rgb(var(--border)); }
.etb-tbl td { height: var(--row-h, 44px); padding: 0 10px; border-bottom: 1px solid rgb(var(--border)); transition: background .15s; }
.etb-tbl td:first-child { font: 600 12px ui-monospace, monospace; color: rgb(var(--brand-700)); } .dark .etb-tbl td:first-child { color: rgb(var(--brand-300)); }
.etb-tbl tbody tr:hover td { background: rgb(var(--surface-2)); }
/* the contrast check */
.etb-ctr-all { padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; } .etb-ctr-all.ok { background: rgb(var(--ok, 5 150 105) / .12); color: rgb(var(--ok, 5 150 105)); } .etb-ctr-all.no { background: rgb(var(--bad, 225 29 72) / .1); color: rgb(var(--bad, 225 29 72)); }
.etb-ctr-l { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.etb-ctr-l li { display: grid; grid-template-columns: 18px 1fr auto auto; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; font-size: 12.5px; }
.etb-ctr-l li.ok > i { color: rgb(var(--ok, 5 150 105)); } .etb-ctr-l li.no { background: rgb(var(--bad, 225 29 72) / .06); } .etb-ctr-l li.no > i { color: rgb(var(--bad, 225 29 72)); }
.etb-ctr-l b { font: 700 12px ui-monospace, monospace; color: rgb(var(--ink-2)); }
.etb-fix { height: 26px; padding: 0 10px; border: 0; border-radius: 7px; background: rgb(var(--bad, 225 29 72)); color: #fff; font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; }
@media (max-width: 1100px) { .etb-two { grid-template-columns: 1fr; } }
/* the preview's stepper: the base look of the shared stepper (.es-steps), on which the theme's data-step-* rules act */
.etb-stepc { padding: 4px 6px 8px; }
.es-steps { --step-d: 28px; display: flex; list-style: none; margin: 0; padding: 12px 6px 4px; }
.es-steps li { position: relative; flex: 1 1 0; min-width: 0; text-align: center; font-size: 11.5px; color: rgb(var(--ink-muted)); }
.es-steps li::before, .es-steps li::after { content: ''; position: absolute; top: calc(var(--step-tag, 0px) + var(--step-d) / 2 - 1px); width: 50%; height: 2px; background: rgb(var(--border)); }
.es-steps li::before { inset-inline-start: 0; }
.es-steps li::after { inset-inline-end: 0; }
.es-steps li:first-child::before, .es-steps li:last-child::after { display: none; }
.es-steps .tag { display: block; height: 16px; margin-bottom: 4px; font-size: 10.5px; font-weight: 500; color: rgb(var(--ink-faint)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.es-steps .n { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: var(--step-d); height: var(--step-d); border-radius: 50%; background: rgb(var(--surface)); border: 2px solid rgb(var(--border-strong)); font-weight: 700; font-size: 11px; color: rgb(var(--ink-2)); transition: width .2s, height .2s, box-shadow .2s, background .2s; }
.es-steps li.done .n { background: rgb(var(--brand-50)); border-color: rgb(var(--brand-500)); color: rgb(var(--brand-700)); }
.dark .es-steps li.done .n { background: rgb(var(--brand-600) / .2); color: rgb(var(--brand-200)); }
.es-steps li.now .n { border-color: rgb(var(--brand-600)); color: rgb(var(--brand-700)); }
.es-steps .ic { position: absolute; bottom: -5px; inset-inline-end: -7px; display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: rgb(var(--surface)); color: rgb(var(--brand-700)); font-size: 8.5px; box-shadow: 0 0 0 1.5px rgb(var(--border)); }
.es-steps .t { display: block; margin-top: 7px; padding-inline: 2px; line-height: 1.35; }
.etb-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; }
.etb-chip i { font-size: 10px; }
.etb-royal { display: flex; align-items: center; gap: 10px; width: 100%; margin: 12px 0 4px; padding: 10px 12px; border: 1px solid rgb(var(--border)); border-radius: 12px; background: rgb(var(--surface)); color: rgb(var(--ink)); font: inherit; cursor: pointer; text-align: start; transition: border-color .15s, transform .15s; }
.etb-royal:hover { border-color: rgb(var(--brand-400)); transform: translateY(-1px); }
.etb-royal > span { width: 44px; height: 28px; border-radius: 8px; flex: none; }
.etb-royal b { font-size: 13px; flex: 1; }
.etb-royal small { font: 600 11px ui-monospace, monospace; color: rgb(var(--ink-muted)); }
/* the preview's KPI cards: a copy of the Payroll card (theme.css .kpi, .kpis > .kpi:first-child), so «حسب الشاشة» looks like Payroll */
.etb-sample .kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.etb-sample .kpi { position: relative; overflow: hidden; display: block; padding: 14px 16px; text-align: start; border: 1px solid rgb(var(--border)); border-radius: 14px; background: rgb(var(--surface)); box-shadow: 0 1px 2px rgb(15 23 42 / .05); transition: transform .15s, box-shadow .15s, border-color .15s; }
.etb-sample .kpi::after { content: ''; position: absolute; inset-block: 12px; inset-inline-start: 0; width: 3px; border-radius: 3px; background: rgb(var(--brand-500)); opacity: .9; }
.etb-sample .kpi:nth-child(4n+2)::after { background: rgb(var(--ch-4)); }
.etb-sample .kpi:nth-child(4n+3)::after { background: rgb(var(--ch-3)); }
.etb-sample .kpi:nth-child(4n+4)::after { background: rgb(var(--ch-8)); }
.etb-sample .kpis > .kpi:first-child { border: 1px solid transparent; background: linear-gradient(rgb(var(--surface)), rgb(var(--surface))) padding-box, var(--grad-brand) border-box; box-shadow: 0 8px 22px -14px rgb(var(--brand-600) / .55); }
.etb-sample .kpis > .kpi:first-child::after { display: none; }
.etb-sample .kpi .l { font-size: 11.5px; font-weight: 600; color: rgb(var(--ink-muted)); }
.etb-sample .kpi .v { margin-top: 6px; font-size: 22px; font-weight: 800; letter-spacing: -.01em; color: rgb(var(--ink)); font-variant-numeric: tabular-nums; }
.etb-sample .kpi .v small { font-size: 11px; font-weight: 600; color: rgb(var(--ink-muted)); }
.etb-sample .kpi .s { margin-top: 6px; font-size: 11px; color: rgb(var(--ink-muted)); }
.etb-sample .chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.etb-sample .chip i { font-size: 10px; }
.etb-sample .chip.c-amber { background: rgb(var(--warn) / .12); color: rgb(var(--warn)); }
.etb-sample .chip.c-green { background: rgb(var(--ok) / .12); color: rgb(var(--ok)); }
.etb-sample .chip.c-gray { background: rgb(var(--surface-2)); color: rgb(var(--ink-muted)); font-family: ui-monospace, monospace; }
/* the icon a screen may give a KPI card: Payroll's cards have none, so the preview shows it only when the icon control is set */
.etb-radef { margin-bottom: 10px; }
.ets-rad[hidden] { display: none; }
/* a narrow window: the preview stays on top and in view while the controls scroll under it, so every change is seen as it is made
 * (owner 2026-11-18: «ما زالت المعاينة لا تظهر مباشرة عند تغيير في الكمبوننت») */
@media (max-width: 900px) {
  .etb-main { grid-template-columns: 1fr; grid-template-rows: minmax(240px, 48vh) minmax(0, 1fr); }
  .etb-prev { order: -1; border-bottom: 2px solid rgb(var(--brand-200)); }
  .etb-side { max-height: none; min-height: 0; border-inline-end: 0; }
  .etb-live, .etb-frame, .etb-page .etb-live, .etb-page .etb-frame { min-height: 0; height: 100%; }
  .etb-kpis, .etb-charts, .etb-two { grid-template-columns: 1fr; }
  .etb-namef span { display: none; }
  .ets.etb { inset: 0; border-radius: 0; }
}
/* a choice that has nothing to act on in the screen being previewed says so, instead of seeming not to work */
.etb-none { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 12px; border-radius: 10px; background: rgb(var(--info, 2 132 199) / .1); color: rgb(var(--info, 2 132 199)); font-size: 12px; font-weight: 600; }
.etb-none[hidden] { display: none; }
.etb-none button { margin-inline-start: auto; height: 28px; padding: 0 10px; border: 0; border-radius: 8px; background: rgb(var(--info, 2 132 199)); color: #fff; font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; }
@media (max-width: 900px) { html:not([data-nav="hidden"]) .etb-app { grid-template-columns: 56px minmax(0, 1fr); } .etb-pi { justify-content: center; padding: 0; } .etb-pi em { display: none; } }   /* a narrow preview folds its mock side menu */
.etb-sub { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; padding-top: 12px; border-top: 2px solid rgb(var(--brand-100)); font-size: 13px; font-weight: 800; color: rgb(var(--brand-800)); }
.dark .etb-sub { color: rgb(var(--brand-200)); border-top-color: rgb(var(--brand-600) / .3); }
.etb-sample .card-h h3 { display: flex; align-items: center; gap: 6px; } .etb-sample .card-h h3 > i { font-size: 12px; color: rgb(var(--ink-muted)); }
.etb-btns button { display: inline-flex; align-items: center; gap: 6px; }
.ets-seg:has(> :nth-child(5)) { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }   /* five choices or more wrap instead of overflowing */
.ets-seg button { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.etb-starts { display: flex; flex-wrap: wrap; gap: 6px; }
.etb-start { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px; border: 1px solid rgb(var(--border)); border-radius: 999px; background: rgb(var(--surface)); color: rgb(var(--ink-2)); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: border-color .15s, transform .15s; }
.etb-start:hover { border-color: rgb(var(--brand-400)); transform: translateY(-1px); } .etb-start[aria-pressed="true"] { border-color: rgb(var(--brand-600)); box-shadow: 0 0 0 2px rgb(var(--brand-600) / .2); color: rgb(var(--ink)); }
.etb-start span { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.etb-base { display: inline-flex; align-items: center; gap: 6px; max-width: 360px; padding: 4px 10px; border-radius: 999px; background: rgb(var(--brand-50)); color: rgb(var(--brand-800)); font-size: 11.5px; font-weight: 600; } .etb-base[hidden] { display: none; } .dark .etb-base { background: rgb(var(--brand-600) / .18); color: rgb(var(--brand-200)); }
/* phase two: the sample windows of the preview take the shared shell's own look (emis-shell.css .es-modal-w / .es-mb / .es-modal / .es-drawer),
 * held inside the preview instead of the whole page, so the window controls show on them as they do on a module */
.etb-prev { position: relative; }
.etb-prev .etb-demo { position: absolute; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; padding: 16px; }
.etb-prev .etb-demo.es-drawer-w { justify-content: flex-end; padding: 0; }
.etb-prev .etb-demo .es-mb { position: absolute; inset: 0; background: rgb(15 23 42 / .5); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.etb-prev .etb-demo :is(.es-modal, .es-drawer) { position: relative; display: flex; flex-direction: column; background: rgb(var(--surface)); color: rgb(var(--ink)); box-shadow: 0 30px 60px -20px rgb(0 0 0 / .5); animation: pop-slide .25s cubic-bezier(.22, 1, .36, 1); }
.etb-prev .etb-demo .es-modal { width: 100%; max-width: 460px; border-radius: 18px; overflow: hidden; }
.etb-prev .etb-demo .es-drawer { width: min(420px, 90%); height: 100%; }
.etb-prev .etb-demo .es-m-h { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid rgb(var(--border)); font-size: 15px; }
.etb-prev .etb-demo .es-m-h i { color: rgb(var(--brand-600)); }
.etb-prev .etb-demo .es-m-b { padding: 16px; font-size: 13px; color: rgb(var(--ink-2)); line-height: 1.7; }
.etb-prev .etb-demo .es-m-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid rgb(var(--border)); }
.etb-prev .etb-demo .es-m-f button { height: 36px; padding: 0 16px; border-radius: var(--r-ctl, 10px); font: inherit; font-size: 13px; font-weight: 700; }
html[data-drawer-side="start"] .etb-prev .etb-demo.es-drawer-w { justify-content: flex-start !important; }
html[data-drawer-w="420"] .etb-prev .etb-demo .es-drawer { width: min(420px, 90%) !important; } html[data-drawer-w="560"] .etb-prev .etb-demo .es-drawer { width: min(560px, 90%) !important; } html[data-drawer-w="720"] .etb-prev .etb-demo .es-drawer { width: min(720px, 94%) !important; }
.etb-prev .etb-demo-toasts { position: absolute; z-index: 6; bottom: 18px; inset-inline-end: 18px; display: flex; flex-direction: column; gap: 8px; }
.etb-demo-toast { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: rgb(6 78 59 / .92); color: #fff; font-size: 13px; font-weight: 600; box-shadow: 0 12px 30px -10px rgb(0 0 0 / .4); animation: pop-slide .25s ease-out; }
html[data-toast-pos="top-end"] .etb-prev .etb-demo-toasts { top: 56px; bottom: auto; inset-inline-start: auto; inset-inline-end: 18px; }
html[data-toast-pos="top-center"] .etb-prev .etb-demo-toasts { top: 56px; bottom: auto; inset-inline: 0; align-items: center; }
html[data-toast-pos="bottom-center"] .etb-prev .etb-demo-toasts { bottom: 18px; inset-inline: 0; align-items: center; }
html[data-toast-pos="bottom-start"] .etb-prev .etb-demo-toasts { bottom: 18px; inset-inline-start: 18px; inset-inline-end: auto; }
.etb-sample .etb-band h2 { margin: 0; font-size: 17px; font-weight: 700; color: inherit; }
.etb-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; font-weight: 600; color: rgb(var(--ink-2)); text-decoration: none; }
/* phase three: the theme tools in the builder header */
.etb-tools { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border: 1px solid rgb(var(--border)); border-radius: 12px; background: rgb(var(--surface-2) / .6); }
.etb-tools button { display: inline-flex; align-items: center; gap: 6px; height: 32px; min-width: 32px; padding: 0 9px; border: 0; border-radius: 9px; background: transparent; color: rgb(var(--ink-2)); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.etb-tools button:hover:not(:disabled) { background: rgb(var(--surface)); color: rgb(var(--brand-700)); box-shadow: 0 1px 2px rgb(15 23 42 / .08); }
.etb-tools button:disabled { opacity: .35; cursor: default; }
.etb-tools button.on { background: rgb(var(--brand-600)); color: #fff; }
.etb-tsep { width: 1px; height: 20px; background: rgb(var(--border)); margin-inline: 2px; }
@media (max-width: 1100px) { .etb-tools button span { display: none; } }
/* the sample band carries the shell's close button (.es-band-x), in the shell's own look, so the band close controls show on it */
.etb-band .es-band-x { flex: none; align-self: flex-start; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-inline-start: 8px; border-radius: 50%; border: 1px solid rgb(255 255 255 / .3); background: rgb(255 255 255 / .16); color: #fff; font: inherit; font-size: 12px; cursor: default; transition: transform .2s, background .15s; }
html[data-head="calm"] .etb-band .es-band-x { color: rgb(var(--ink-2)); background: rgb(var(--surface-2)); border-color: rgb(var(--border)); }
/* the sample record history card of the preview: the shape of the shell's card (emis-shell-pages.css on main, GOV-R271-A), held in the preview */
.etb-prev .etb-demo .es-modal:has(.es-rh) { max-width: 365px; }
.etb-prev .es-rh { display: flex; flex-direction: column; gap: 12px; padding: 14px; }
.etb-prev .es-rh-hh { display: flex; align-items: center; gap: 8px; }
.etb-prev .es-rh-hic { flex: none; width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; background: rgb(var(--brand-50)); color: rgb(var(--brand-700)); }
.etb-prev .es-rh-ht { display: flex; flex-direction: column; } .etb-prev .es-rh-ht b { font-size: 14px; font-weight: 800; } .etb-prev .es-rh-ht small { font-size: 11px; color: rgb(var(--ink-muted)); }
.etb-prev .es-rh-idbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 8px; border: 1px solid rgb(var(--border)); background: rgb(var(--surface-2)); font: 600 12px ui-monospace, monospace; color: rgb(var(--ink-2)); }
.etb-prev .es-rh-tl { position: relative; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.etb-prev .es-rh-tl::before { content: ''; position: absolute; inset-inline-start: 15px; top: 14px; bottom: 14px; width: 2px; background: rgb(226 232 240); }
.etb-prev .es-rh-ev { display: flex; gap: 10px; align-items: flex-start; }
.etb-prev .es-rh-node { position: relative; z-index: 1; flex: none; width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.etb-prev .es-rh-ev.new .es-rh-node { background: rgb(var(--brand-600)); color: #fff; box-shadow: 0 0 0 3px rgb(var(--surface)); }
.etb-prev .es-rh-ev.upd .es-rh-node { background: rgb(245 158 11); color: #fff; box-shadow: 0 0 0 3px rgb(var(--surface)); }
.etb-prev .es-rh-card { flex: 1; min-width: 0; padding: 10px; border-radius: 12px; border: 1px solid rgb(var(--border)); background: rgb(var(--surface)); box-shadow: 0 1px 2px rgb(15 23 42 / .04); font-size: 12px; }
.etb-prev .es-rh-ev.upd .es-rh-card { border-color: rgb(253 230 138); }
.etb-prev .es-rh-who { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.etb-prev .es-rh-av { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; background: rgb(var(--brand-100)); color: rgb(var(--brand-800)); }
.etb-prev .es-rh-badge { display: inline-flex; padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; border: 1px solid; }
.etb-prev .es-rh-badge.t-new { background: rgb(var(--brand-50)); color: rgb(var(--brand-700)); border-color: rgb(var(--brand-200)); }
.etb-prev .es-rh-badge.t-upd { background: rgb(255 251 235); color: rgb(146 64 14); border-color: rgb(253 230 138); }
.etb-band .es-hist-b { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-inline-start: 8px; border-radius: 50%; border: 1px solid rgb(255 255 255 / .3); background: rgb(255 255 255 / .16); color: #fff; font-size: 12px; }
html[data-head="calm"] .etb-band .es-hist-b { color: rgb(var(--brand-700)); background: rgb(var(--brand-50)); border-color: rgb(var(--brand-200)); }
/* the organisation theme: the banner, the locked controls, the publish window */
.etb-org { display: flex; align-items: center; gap: 10px; margin: 10px 0; padding: 10px 12px; border-radius: 12px; background: linear-gradient(135deg, rgb(var(--brand-50)), rgb(var(--surface))); border: 1px solid rgb(var(--brand-200)); }
.etb-org > i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--grad-brand); color: #fff; flex: none; }
.etb-org b { display: block; font-size: 13px; } .etb-org small { font-size: 11.5px; color: rgb(var(--ink-muted)); }
.dark .etb-org { background: rgb(var(--brand-600) / .12); border-color: rgb(var(--brand-600) / .35); }
.etb-locked { display: flex; align-items: center; gap: 6px; margin: -4px 0 6px; font-size: 11.5px; font-weight: 600; color: rgb(var(--brand-700)); }
.ets-seg.is-locked { opacity: .55; pointer-events: none; }
.etb-orgpub { color: rgb(var(--brand-700)) !important; }
.etb-orgdlg { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgb(15 23 42 / .4); }
.etb-orgbox { width: min(460px, 100%); max-height: 100%; overflow: auto; padding: 18px; border-radius: 16px; background: rgb(var(--surface)); color: rgb(var(--ink)); box-shadow: 0 30px 60px -20px rgb(0 0 0 / .5); animation: pop-zoom .2s ease-out; }
.etb-orgbox h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 16px; } .etb-orgbox h3 i { color: rgb(var(--brand-600)); }
.etb-on2 { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; font-size: 12px; font-weight: 700; }
.etb-orgname { height: 38px; padding: 0 12px; border: 1px solid rgb(var(--border)); border-radius: 10px; background: rgb(var(--surface)); color: rgb(var(--ink)); font: inherit; font-size: 13px; }
.etb-ol { margin: 8px 0 4px; font-size: 12px; font-weight: 700; }
.etb-ock { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; margin-bottom: 6px; border: 1px solid rgb(var(--border)); border-radius: 10px; cursor: pointer; }
.etb-ock:has(input:checked) { border-color: rgb(var(--brand-400)); background: rgb(var(--brand-50) / .6); }
.etb-ock input { margin-top: 3px; accent-color: rgb(var(--brand-600)); } .etb-ock b { display: block; font-size: 13px; } .etb-ock small { font-size: 11.5px; color: rgb(var(--ink-muted)); }
.etb-orgnote { display: flex; gap: 8px; margin: 10px 0; padding: 8px 10px; border-radius: 10px; background: rgb(var(--surface-2)); font-size: 11.5px; color: rgb(var(--ink-2)); line-height: 1.6; }
.etb-orgbtns { display: flex; align-items: center; gap: 8px; } .etb-orgbtns > span:not(.etb-orgq) { flex: 1; } .etb-orgq { flex: 1; font-size: 12px; font-weight: 600; }
/* the image picker of the sign-in tab */
.etb-imgpick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.etb-imgpick img, .etb-imgnone { width: 72px; height: 48px; flex: none; border-radius: 8px; border: 1px solid rgb(var(--border)); object-fit: cover; background: rgb(var(--surface-2)); display: grid; place-items: center; color: rgb(var(--ink-faint)); }
.etb-imgup, .etb-imgclr { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid rgb(var(--border-strong)); background: rgb(var(--surface)); color: rgb(var(--ink-2)); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.etb-imgup:hover, .etb-imgclr:hover { border-color: rgb(var(--brand-400)); color: rgb(var(--brand-700)); }
.etb-imgup:focus-within, .etb-imgclr:focus-visible { outline: 2px solid rgb(var(--brand-500)); outline-offset: 2px; }
.etb-imgerr { flex-basis: 100%; color: rgb(190 18 60); font-size: 12px; }
/* CR-726 / GOV-R349-A */
/* the branding tab: the organisation name field; the branding slot of the sample top bar (as the shell draws it: the logo on a light tile, the name) */
.etb-brandf { display: flex; flex-direction: column; gap: 6px; }
.etb-brandn { width: 100%; height: var(--control-h, 40px); padding: 0 12px; border: 1px solid rgb(var(--border-strong)); border-radius: var(--r-ctl, 10px); background: rgb(var(--surface)); color: rgb(var(--ink)); font: inherit; font-size: var(--fs-3, 14px); }
.etb-brandn:focus-visible { outline: 2px solid rgb(var(--brand-600)); outline-offset: 2px; }
.etb-brandn[aria-invalid="true"] { border-color: rgb(var(--bad)); }
.etb-pbrand { display: inline-flex; align-items: center; gap: 6px; max-width: 180px; min-width: 0; padding-inline-end: 8px; border-inline-end: 1px solid rgb(var(--on-brand) / .25); }
.etb-pbrand[hidden] { display: none; }
.etb-pbrand img { height: 26px; max-width: 80px; padding: 2px 5px; border-radius: 8px; background: rgb(var(--on-brand)); object-fit: contain; }
.etb-pbrand b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* CR-726 / GOV-R350-A */
/* the overview tab: read-only cards of datum cells (label over value), the three locks as chips with an icon and a word */
.ets-body section.etb-ovc { margin-bottom: 12px; padding: 0; background: rgb(var(--surface)); border: 1px solid rgb(var(--border)); border-radius: var(--r-card, 16px); }
.etb-ovc .card-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px 0; }
.etb-ovc .card-h h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: var(--fs-3, 14px); font-weight: 700; color: rgb(var(--ink)); }
.etb-ovc .card-h h3 > i { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: rgb(var(--brand-600)); color: rgb(var(--on-brand)); font-size: 12px; }
.etb-ovc .card-b { padding: 10px 14px 14px; }
.etb-ovg { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.etb-ovd { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 8px 10px; border-radius: var(--r-ctl, 10px); background: rgb(var(--surface-2)); }
.etb-ovd small { font-size: var(--fs-1, 12px); font-weight: 600; color: rgb(var(--ink-muted)); }
.etb-ovd b { font-size: var(--fs-3, 14px); font-weight: 700; color: rgb(var(--ink)); overflow-wrap: anywhere; }
.etb-ovd em { font-style: normal; font-size: var(--fs-1, 12px); font-weight: 600; color: rgb(var(--ink-2)); font-variant-numeric: tabular-nums; }
.etb-ovd b[dir="ltr"] { font-variant-numeric: tabular-nums; }
.etb-ovls { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.etb-ovl { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; border: 1px solid rgb(var(--border-strong)); background: rgb(var(--surface)); color: rgb(var(--ink-2)); font-size: var(--fs-1, 12px); font-weight: 600; }
.etb-ovl.on { border-color: rgb(var(--brand-300)); background: rgb(var(--brand-50)); color: rgb(var(--brand-700)); }
.dark .etb-ovl.on { background: rgb(var(--brand-600) / .14); color: rgb(var(--brand-200)); }
/* the ready sign-in looks of the sign-in tab */
.etb-lglooks { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.etb-lglook { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 10px; border-radius: 10px; border: 1px solid rgb(var(--border-strong)); background: rgb(var(--surface)); color: rgb(var(--ink-2)); font: inherit; font-size: 12.5px; font-weight: 600; text-align: start; cursor: pointer; }
.etb-lglook i { color: rgb(var(--brand-600)); }
.etb-lglook:hover { border-color: rgb(var(--brand-400)); }
.etb-lglook[aria-pressed="true"] { border-color: rgb(var(--brand-600)); background: rgb(var(--brand-50)); color: rgb(var(--brand-800)); box-shadow: 0 0 0 1px rgb(var(--brand-600)); }
.etb-lglook:focus-visible { outline: 2px solid rgb(var(--brand-500)); outline-offset: 2px; }
.etb-orgsec { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }   /* GOV-R282: the withdrawal lives on SCR-SEC-B09 */
/* the device and language switches of the live preview (owner 2026-11-18, «Theme Builder User Experience») */
.etb-dev { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid rgb(var(--border)); border-radius: 10px; background: rgb(var(--surface)); }
.etb-dev[hidden] { display: none; }
.etb-dev button { display: inline-flex; align-items: center; gap: 6px; height: 30px; min-width: 32px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: rgb(var(--ink-2)); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.etb-dev button:hover { background: rgb(var(--surface-2)); }
.etb-dev button[aria-pressed="true"] { background: rgb(var(--brand-600)); color: #fff; }
.etb-dev button:focus-visible { outline: 2px solid rgb(var(--brand-500)); outline-offset: 1px; }
.etb-dev [data-flang] { border-inline-start: 1px solid rgb(var(--border)); border-radius: 0 8px 8px 0; margin-inline-start: 2px; }
/* the level filter and folding group headings of the builder tabs (owner 2026-11-18, «Theme Builder User Experience») */
.etb-lvl { position: sticky; top: -6px; z-index: 2; display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; margin: 0 0 10px; border: 1px solid rgb(var(--border)); border-radius: 0 0 12px 12px; background: rgb(var(--surface)); box-shadow: 0 -8px 0 rgb(var(--surface)); backdrop-filter: blur(6px); }
.etb-lvl button { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: rgb(var(--ink-2)); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.etb-lvl button small { min-width: 20px; padding: 0 6px; border-radius: 999px; background: rgb(var(--surface-2)); color: rgb(var(--ink-muted)); font-size: 11px; line-height: 18px; }
.etb-lvl button:hover:not(:disabled) { background: rgb(var(--surface-2)); }
.etb-lvl button[aria-pressed="true"] { background: rgb(var(--brand-600)); color: #fff; }
.etb-lvl button[aria-pressed="true"] small { background: rgb(255 255 255 / .22); color: #fff; }
.etb-lvl button:disabled { opacity: .45; cursor: not-allowed; }
.etb-lvl button:focus-visible { outline: 2px solid rgb(var(--brand-500)); outline-offset: 1px; }
.ets-body h5.etb-sub[data-grp] { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 8px; }
.ets-body h5.etb-sub[data-grp]::after { content: '\f107'; font-family: 'Font Awesome 6 Free'; font-weight: 900; margin-inline-start: auto; transition: transform .18s; color: rgb(var(--ink-muted)); }
.ets-body h5.etb-sub[data-grp][aria-expanded="false"]::after { transform: rotate(-90deg); }
html[dir="rtl"] .ets-body h5.etb-sub[data-grp][aria-expanded="false"]::after { transform: rotate(90deg); }
.ets-body h5.etb-sub[data-grp]:focus-visible { outline: 2px solid rgb(var(--brand-500)); outline-offset: 2px; border-radius: 6px; }
/* the theme library toolbar (owner 2026-11-18: «Theme Marketplace / Library داخلي») */
.etb-lib { position: sticky; top: -6px; z-index: 2; display: grid; gap: 8px; padding: 8px; margin: 0 0 10px; border: 1px solid rgb(var(--border)); border-radius: 0 0 12px 12px; background: rgb(var(--surface)); box-shadow: 0 -8px 0 rgb(var(--surface)); backdrop-filter: blur(6px); }
/* GOV-R316-A (CR-706): the sticky bar sits flush with the top of the scrolling list (its 6px padding) on an opaque surface, so no card shows above or through it */
.etb-libq { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; border: 1px solid rgb(var(--border-strong)); border-radius: 10px; background: rgb(var(--surface)); color: rgb(var(--ink-muted)); }
.etb-libq:focus-within { border-color: rgb(var(--brand-500)); box-shadow: 0 0 0 3px rgb(var(--brand-500) / .15); }
.etb-libq input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: rgb(var(--ink)); font: inherit; font-size: 13px; }
.etb-libf { display: flex; flex-wrap: wrap; gap: 4px; }
.etb-libf button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid rgb(var(--border)); border-radius: 999px; background: rgb(var(--surface)); color: rgb(var(--ink-2)); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.etb-libf button:hover { border-color: rgb(var(--brand-400)); }
.etb-libf button[aria-pressed="true"] { background: rgb(var(--brand-600)); border-color: rgb(var(--brand-600)); color: #fff; }
.etb-libf button:focus-visible { outline: 2px solid rgb(var(--brand-500)); outline-offset: 2px; }
.etb-libn { margin: 0; }
.ets-look[hidden] { display: none; }
/* the colour of each module in the organisation theme dialog (GOV-R285-A) */
.etb-omods { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));   /* SEC-R065-A (CR-706): wider rows hold the theme of the module */ gap: 6px 10px; max-height: 220px; overflow-y: auto; padding: 2px; }
.etb-omod { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12.5px; }
.etb-omod > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: rgb(var(--ink-2)); }
.etb-omod select { height: 32px; border: 1px solid rgb(var(--border-strong)); border-radius: 8px; background: rgb(var(--surface)); color: rgb(var(--ink)); font: inherit; font-size: 12px; padding: 0 6px; }
.etb-omod input[type="color"] { width: 32px; height: 32px; padding: 2px; border: 1px solid rgb(var(--border-strong)); border-radius: 8px; background: rgb(var(--surface)); }
.etb-omod input[hidden] { display: none; }
.etb-omod select.etb-omt { max-width: 160px; }   /* SEC-R065-A (CR-706): the theme of the module */
/* GOV-R297-A (CR-667): the two modes of the builder and the search across its settings */
.etb-find { display: grid; gap: 8px; padding: 10px 10px 8px; border-bottom: 1px solid rgb(var(--border)); }
.etb-mode { display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: rgb(var(--surface-2)); }
.etb-mode button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; border: 0; border-radius: 8px; background: transparent; color: rgb(var(--ink-2)); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background-color .15s, color .15s; }
.etb-mode button:hover { color: rgb(var(--ink)); }
.etb-mode button[aria-pressed="true"] { background: rgb(var(--surface)); color: rgb(var(--brand-700)); box-shadow: 0 1px 3px rgb(var(--ink) / .14); }
html.dark .etb-mode button[aria-pressed="true"] { color: rgb(var(--brand-300)); }
.etb-mode button:focus-visible, .etb-hit:focus-visible, .etb-more button:focus-visible { outline: 2px solid rgb(var(--brand-500)); outline-offset: 2px; }
.etb-q { position: relative; display: flex; align-items: center; }
.etb-q > i { position: absolute; inset-inline-start: 11px; color: rgb(var(--ink-muted)); font-size: 12px; pointer-events: none; }
.etb-qi { width: 100%; min-height: 36px; padding: 0 34px; border: 1px solid rgb(var(--border-strong)); border-radius: 10px; background: rgb(var(--surface)); color: rgb(var(--ink)); font: inherit; font-size: 13px; }
.etb-qi::placeholder { color: rgb(var(--ink-muted)); }
.etb-qi:focus { outline: 2px solid rgb(var(--brand-500)); outline-offset: 1px; }
.etb-q kbd { position: absolute; inset-inline-end: 8px; min-width: 20px; padding: 0 5px; border: 1px solid rgb(var(--border-strong)); border-radius: 5px; color: rgb(var(--ink-muted)); font: 600 11px/18px ui-monospace, monospace; text-align: center; pointer-events: none; }
.etb-qi:not(:placeholder-shown) + kbd { display: none; }
.etb-tabs button[hidden] { display: none !important; }
.etb-res { display: grid; gap: 6px; }
.etb-res-h { margin: 0 0 4px; color: rgb(var(--ink-muted)); font-size: 12.5px; }
.etb-hit { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid rgb(var(--border)); border-radius: 12px; background: rgb(var(--surface)); color: rgb(var(--ink)); font: inherit; text-align: start; cursor: pointer; transition: border-color .15s, background-color .15s; }
.etb-hit > i:first-child { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: rgb(var(--brand-600) / .1); color: rgb(var(--brand-700)); font-size: 13px; }
html.dark .etb-hit > i:first-child { color: rgb(var(--brand-300)); }
.etb-hit span { flex: 1; min-width: 0; display: grid; gap: 2px; }
.etb-hit b { font-size: 13.5px; }
.etb-hit small { overflow: hidden; color: rgb(var(--ink-muted)); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.etb-hit-go { flex: none; color: rgb(var(--ink-faint)); font-size: 12px; transition: transform .15s, color .15s; }
.etb-hit:hover, .etb-hit:focus-visible { border-color: rgb(var(--brand-400)); background: rgb(var(--brand-600) / .05); }
.etb-hit:hover .etb-hit-go, .etb-hit:focus-visible .etb-hit-go { color: rgb(var(--brand-600)); transform: translateX(-3px); }
html[dir="ltr"] .etb-hit:hover .etb-hit-go, html[dir="ltr"] .etb-hit:focus-visible .etb-hit-go { transform: translateX(3px); }
.etb-res-none { display: grid; justify-items: center; gap: 6px; margin: 0; padding: 32px 16px; color: rgb(var(--ink-muted)); text-align: center; }
.etb-res-none i { color: rgb(var(--ink-faint)); font-size: 22px; }
.etb-res-none b { color: rgb(var(--ink)); }
.etb-more { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.etb-more button { border: 0; background: none; color: rgb(var(--brand-700)); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
html.dark .etb-more button { color: rgb(var(--brand-300)); }
.ets-body section.etb-flash { border-radius: 12px; animation: etb-flash 1.8s ease-out; }
@keyframes etb-flash { 0%, 35% { background: rgb(var(--brand-600) / .08); box-shadow: 0 0 0 3px rgb(var(--brand-500) / .55); } 100% { box-shadow: 0 0 0 3px rgb(var(--brand-500) / 0); } }
@media (prefers-reduced-motion: reduce) { .ets-body section.etb-flash { animation: none; box-shadow: 0 0 0 3px rgb(var(--brand-500) / .55); } }
html[data-es-motion="reduce"] .ets-body section.etb-flash { animation: none; box-shadow: 0 0 0 3px rgb(var(--brand-500) / .55); }
/* GOV-R298-A (CR-667): on a dark look the chosen tab of the studio and the builder reads in the light shade of the theme colour (the dark shade
 * fell to 1.4:1 on a dark surface with a deep theme colour such as «تباين عالٍ داكن» or Material 3 dark) */
html.dark .ets-tabs button[aria-selected="true"] { color: rgb(var(--brand-200)); box-shadow: 0 0 0 1px rgb(var(--brand-400)); }
html.dark .ets-tabs button[aria-selected="true"] i { color: rgb(var(--brand-300)); }

/* GOV-R317-A (CR-707): the builder by page component: six group buttons, then the tabs of the shown group only */
.etb-tgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 10px 18px 0; }
.etb-tgs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 4px 6px; border: 1px solid rgb(var(--border)); border-radius: 9px; background: rgb(var(--surface)); color: rgb(var(--ink-2)); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; text-align: center; line-height: 1.25; }
.etb-tgs button i { font-size: 12px; opacity: .75; }
.etb-tgs button:hover { border-color: rgb(var(--brand-300)); color: rgb(var(--brand-700)); }
.etb-tgs button[aria-pressed="true"] { background: rgb(var(--brand-600)); border-color: rgb(var(--brand-600)); color: rgb(var(--on-brand, 255 255 255)); }
.etb-tgs button[aria-pressed="true"] i { opacity: 1; }
.etb-tgs button[hidden], .etb-tabs button[data-out="true"] { display: none !important; }
html.dark .etb-tgs button[aria-pressed="true"] { background: rgb(var(--brand-500)); border-color: rgb(var(--brand-500)); }

/* SEC-R066-A (CR-710): the banner of a draft of the organisation being edited, and the draft button of the publish window */
.etb-draftb { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border: 1px solid rgb(var(--warn) / .35); border-radius: 999px; background: rgb(var(--warn) / .1); color: color-mix(in srgb, rgb(var(--warn)) 70%, rgb(var(--ink))); font-size: 12px; font-weight: 600; white-space: nowrap; }
.etb-draftb .etb-draftx { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 999px; background: transparent; color: inherit; cursor: pointer; }
.etb-draftb .etb-draftx:hover { background: rgb(var(--warn) / .18); }
.etb-orgbtns .etb-orgdraft i { color: rgb(var(--warn)); }

/* CR-718 ([DOCUMENTED REQUIREMENT — GOV-R385-A, GOV-R369-A], owner 2026-11-20 «هيكلية هذه الشاشة غير عملية»): the builder in three columns: one side rail
 * of sections (every tab under its group heading; it replaces the group bar, the tab row and their chips), the settings of the open section, the preview.
 * The preview can be hidden (the settings then take the whole width), the less frequent tools sit in «المزيد», and the footer stays in view. Theme
 * variables only; nothing here changes a setting or what a module screen draws. */
.ets.etb { max-height: 100dvh; }
.etb > footer { flex: none; }
.etb-main { grid-template-columns: 216px minmax(380px, 480px) minmax(0, 1fr); }
.etb-rail { grid-column: 1; grid-row: 1; order: -1; display: flex; flex-direction: column; align-items: stretch; gap: 2px; margin: 0; padding: 12px 10px 18px; border: 0; border-inline-end: 1px solid rgb(var(--border)); border-radius: 0; background: rgb(var(--surface-2) / .6); overflow-y: auto; overflow-x: hidden; min-height: 0; }
.etb-rail .etb-rcap { display: flex; align-items: center; gap: 7px; margin: 12px 8px 4px; font-size: 11px; font-weight: 700; letter-spacing: .02em; color: rgb(var(--ink-muted)); }
.etb-rail .etb-rcap:first-child { margin-top: 2px; }
.etb-rail .etb-rcap[hidden] { display: none; }
.etb-rail .etb-rcap i { font-size: 11px; opacity: .8; }
.etb-rail button { justify-content: flex-start; height: 36px; padding: 0 12px; text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.etb-rail button[data-out="true"]:not([hidden]) { display: inline-flex !important; }
.etb-rail button[aria-selected="true"] { background: rgb(var(--surface)); color: rgb(var(--brand-700)); box-shadow: inset 3px 0 0 rgb(var(--brand-600)), 0 1px 2px rgb(15 23 42 / .08); }
html[dir="rtl"] .etb-rail button[aria-selected="true"] { box-shadow: inset -3px 0 0 rgb(var(--brand-600)), 0 1px 2px rgb(15 23 42 / .08); }
.etb-main > .etb-side { grid-column: 2; grid-row: 1; }
.etb-main > .etb-prev { grid-column: 3; grid-row: 1; }
.etb-noprev .etb-main { grid-template-columns: 216px minmax(0, 1fr); }
.etb-noprev .etb-prev { display: none; }
.etb-noprev .etb-main > .etb-side { border-inline-end: 0; }
.etb-tgs[hidden] { display: none !important; }
.etb-more { position: relative; display: inline-flex; }
.etb-menu { position: absolute; inset-block-start: calc(100% + 6px); inset-inline-end: 0; z-index: 30; display: flex; flex-direction: column; gap: 2px; min-width: 210px; padding: 6px; border: 1px solid rgb(var(--border)); border-radius: 12px; background: rgb(var(--surface)); box-shadow: var(--float-2, 0 12px 28px -12px rgb(15 23 42 / .35)); }
.etb-menu[hidden] { display: none; }
.etb-menu .etb-tsep { display: none; }
.etb-menu button { justify-content: flex-start; width: 100%; }
.etb-prevtog[aria-pressed="false"] { color: rgb(var(--brand-700)); border-color: rgb(var(--brand-300)); }
html.dark .etb-rail { background: rgb(var(--surface-2) / .35); }
html.dark .etb-rail button[aria-selected="true"] { color: rgb(var(--brand-200)); }
@media (max-width: 1100px) {
  .etb-main { grid-template-columns: 190px minmax(0, 1fr); }
  .etb-main > .etb-prev { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 900px) {
  .etb-main { grid-template-columns: 1fr; grid-template-rows: auto minmax(240px, 42vh) minmax(0, 1fr); }
  .etb-rail { grid-column: 1; grid-row: 1; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; padding: 8px; border-inline-end: 0; border-bottom: 1px solid rgb(var(--border)); }
  .etb-rail .etb-rcap { display: none; }
  .etb-rail button { flex: none; overflow: visible; text-overflow: clip; }
  .etb-main > .etb-prev { grid-column: 1; grid-row: 2; }
  .etb-main > .etb-side { grid-column: 1; grid-row: 3; }
}

/* CR-719 ([DOCUMENTED REQUIREMENT — GOV-R386-A]): the preview in a window of its own. While the window is open the preview pane of the builder is hidden
 * (the settings take the whole width) and the header button reads «إعادة المعاينة إلى هنا»; the sign-in tab offers its own window. Theme variables only. */
.etb-popbtn[aria-pressed="true"] { color: rgb(var(--brand-700)); border-color: rgb(var(--brand-300)); background: rgb(var(--brand-50)); }
html.dark .etb-popbtn[aria-pressed="true"] { color: rgb(var(--brand-200)); background: rgb(var(--brand-600) / .15); }
.etb-popcta { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; width: 100%; margin: 0 0 12px; padding: 10px 12px; border: 1px dashed rgb(var(--brand-300)); border-radius: 12px; background: rgb(var(--brand-50) / .6); color: rgb(var(--brand-700)); font: inherit; font-weight: 700; font-size: 13px; text-align: start; cursor: pointer; }
.etb-popcta i { grid-row: span 2; font-size: 15px; }
.etb-popcta small { grid-column: 2; font-weight: 500; font-size: 11.5px; color: rgb(var(--ink-muted)); }
.etb-popcta:hover { border-style: solid; background: rgb(var(--brand-50)); }
html.dark .etb-popcta { background: rgb(var(--brand-600) / .12); color: rgb(var(--brand-200)); }
