/* Storefront content uses the shared اكتبلي header and theme. */
html:root[data-theme=light] body.market-gallery{
 --color-bg:#f6f8fb;--color-surface:#fff;--color-surface-subtle:#eef3f8;
 --color-text:#132b45;--color-text-muted:#63758a;--color-border:#dce5ef;
}
body.market-gallery{
 --market-navy:var(--color-primary);--market-ink:var(--color-text);--market-muted:var(--color-text-muted);--market-line:var(--color-border);--market-soft:var(--color-surface-subtle);--market-white:var(--color-surface);
 --bg:var(--color-bg);--card:var(--color-surface);--surface:var(--color-surface);--surface2:var(--color-surface-subtle);--text:var(--color-text);--muted:var(--color-text-muted);--line:var(--color-border);--blue:var(--color-primary);--accent:var(--color-primary);--accent2:var(--color-primary-hover);--soft:var(--color-surface-subtle);
 display:block;margin:0;direction:rtl;background:var(--color-bg);color:var(--color-text);font:400 14px/1.7 Cairo,Tahoma,sans-serif;
}
.market-gallery *{box-sizing:border-box}.market-gallery [hidden]{display:none!important}
.market-visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
html body.market-gallery .market-shell{width:min(1320px,calc(100% - 64px));margin:28px auto 0;padding:0;min-width:0}
.market-gallery .market-heading{display:flex;align-items:center;justify-content:space-between;gap:24px;margin:0 0 24px}
.market-gallery .market-heading h1{margin:0 0 4px;font-size:30px;font-weight:800;line-height:1.5;letter-spacing:0;color:var(--color-text)}
.market-gallery .market-heading p{margin:0;font-size:14px;color:var(--color-text-muted);line-height:1.8}
.market-gallery .market-orders-link{flex:none;background:var(--color-surface);font-size:13px;gap:9px;padding-inline:18px}
.market-orders-link svg{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.market-gallery .gallery-catalog{padding:0;scroll-margin-top:24px}
.market-gallery .market-filter-panel{padding:16px 18px;background:var(--color-surface);border:1px solid var(--color-border);border-radius:12px}
.market-gallery .gallery-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:16px;padding:0;margin:0;border:0;background:transparent}
.market-gallery .marketplace-header-search{display:flex;flex:1;align-items:center;gap:10px;min-width:220px;height:46px;padding:0 14px;background:var(--color-bg);border:1px solid var(--color-border);border-radius:8px;color:var(--color-text-muted)}
.market-gallery .marketplace-header-search svg{width:20px;height:20px;stroke:currentColor;stroke-width:1.6;fill:none;flex:none}
.market-gallery .marketplace-header-search input{min-width:0;width:100%;padding:0;border:0;outline:0;background:transparent;color:var(--color-text);font:inherit;box-shadow:none}
.market-gallery .marketplace-header-search input::placeholder{color:var(--color-text-muted)}
.market-gallery .marketplace-header-search:focus-within{outline:2px solid var(--color-focus);outline-offset:2px}
.market-gallery .gallery-filters{display:flex;gap:3px;padding:3px;background:var(--color-bg);border:1px solid var(--color-border);border-radius:8px;width:auto}
.market-gallery .gallery-filters button{min-height:44px;padding:6px 16px;border:0;border-radius:5px;background:transparent;color:var(--color-text-muted);font:600 12px/1.6 Cairo,sans-serif}
.market-gallery .gallery-filters button[aria-pressed=true]{background:var(--color-surface);color:var(--color-primary);box-shadow:0 1px 4px #001b3614}
.market-gallery .gallery-sort{display:flex;align-items:center;gap:8px;margin:0;width:auto;font-size:12px;color:var(--color-text-muted)}
.market-gallery .gallery-sort select{width:162px;max-width:190px;min-height:46px;padding:8px 10px;background:var(--color-surface);color:var(--color-text);border:1px solid var(--color-border);border-radius:8px;font:600 12px/1.7 Cairo,sans-serif}
.market-gallery .marketplace-subjects{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0 0;padding:0}
.market-gallery .marketplace-subjects button{min-height:44px;padding:6px 16px;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--color-text-muted);font:600 13px/1.7 Cairo,sans-serif;cursor:pointer}
.market-gallery .marketplace-subjects button:hover{background:var(--color-surface-subtle);color:var(--color-primary)}
.market-gallery .marketplace-subjects button[aria-pressed=true]{background:var(--color-primary);color:var(--color-surface);border-color:var(--color-primary)}
.market-gallery .gallery-results-bar{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:12px;min-height:46px;margin:0;padding:4px 2px}
.market-gallery .gallery-results-bar p{font-size:12px;color:var(--color-text-muted);margin:0}
.market-gallery .gallery-text-link{color:var(--color-primary);font-size:12px;font-weight:600;min-height:44px;white-space:normal}
.market-gallery .market-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px;direction:rtl}
.market-gallery .market-card{min-width:0;min-height:0;padding:0;border:1px solid var(--color-border);border-radius:12px;background:var(--color-surface);box-shadow:0 3px 12px #08274804;overflow:hidden;transition:box-shadow .15s,border-color .15s}
.market-gallery .market-card:hover{border-color:var(--color-primary);box-shadow:0 6px 20px #0827480d}
.market-gallery .market-thumb{aspect-ratio:16/9;padding:16px;background:var(--color-surface-subtle);border:0;border-bottom:1px solid var(--color-border);border-radius:0;overflow:hidden}
.market-gallery .market-thumb img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 2px 4px #001b3612)}
.market-gallery .gallery-thumb-fallback{display:grid;place-items:center;width:100%;height:100%;max-width:none;min-height:0;padding:20px;text-align:center;background:var(--color-surface);color:var(--color-text-muted);border:1px dashed var(--color-border);border-radius:6px;font-size:15px}
.market-gallery .market-card-body{padding:18px 20px 20px;gap:8px;min-width:0;direction:rtl}
.market-gallery .gallery-card-meta{display:flex;justify-content:space-between;gap:8px;align-items:center;font-size:11px;color:var(--color-text-muted)}
.market-gallery .gallery-project-badge{padding:2px 8px;border-radius:5px;background:var(--color-surface-subtle);color:var(--color-primary);font-weight:600}
.market-gallery .gallery-card-counts{display:flex;flex-wrap:wrap;gap:6px 20px;font-size:13px;line-height:1.8;color:var(--color-text-muted)}
.market-gallery .gallery-card-counts strong{color:var(--color-text);font-weight:700;font-variant-numeric:tabular-nums}
.gallery-unit-filters,.gallery-cart-bar{display:flex;flex-wrap:wrap;align-items:end;gap:12px;padding:16px;margin-bottom:16px;border:1px solid var(--color-border);border-radius:8px;background:var(--color-surface)}
.gallery-unit-filters label{display:grid;gap:6px;flex:1 1 180px;color:var(--color-text);font-size:13px;min-width:0}
.gallery-unit-filters select{width:100%;min-height:44px;border:1px solid var(--color-border);border-radius:6px;padding:8px;background:var(--color-surface-subtle);color:var(--color-text);font:inherit}
.gallery-cart-bar{align-items:center}.gallery-cart-bar p{flex:1 1 230px;margin:0;color:var(--color-text);font-size:13px}
.gallery-select-exercise{display:flex;align-items:center;gap:8px;min-height:44px;font-size:13px;color:var(--color-text);cursor:pointer}.gallery-select-exercise input{width:18px;height:18px;accent-color:var(--color-primary)}
.gallery-classification{font-size:12px;color:var(--color-text-muted);overflow-wrap:anywhere}
.cart-purchase-list{margin:0;padding-inline-start:22px;font-size:13px;color:var(--color-text-muted)}
.market-gallery .market-card h3{font-size:20px;font-weight:700;line-height:1.6;margin:0;color:var(--color-text);overflow-wrap:anywhere}
.market-gallery .market-card p{font-size:13px;line-height:1.8;margin:0;min-height:0;color:var(--color-text-muted);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.market-gallery .market-card-foot{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px;align-items:center;padding:14px 0 0;margin-top:auto;border-top:1px solid var(--color-border)}
.market-gallery .gallery-card-price{grid-column:auto;min-width:0;padding:0;border:0}.market-gallery .gallery-card-price>span{display:none}
.market-gallery .market-price{font-size:16px;font-weight:800;white-space:normal;line-height:1.6;color:var(--color-text)}
.market-gallery .market-btn{min-height:44px;border-radius:7px;font-size:13px;padding:9px 16px;line-height:1.7}
.market-gallery .market-btn.primary{background:var(--color-primary);color:var(--color-surface);border:1px solid var(--color-primary)}
.market-gallery .market-btn.primary:hover:not(:disabled){background:var(--color-primary-hover);border-color:var(--color-primary-hover)}
.market-gallery .market-btn.secondary{background:var(--color-surface);color:var(--color-primary);border:1px solid var(--color-border)}
.market-gallery .market-card-foot .market-btn{min-width:76px;font-size:13px;padding-inline:14px}
.market-gallery .market-preview-button:hover{background:var(--color-surface-subtle);border-color:var(--color-primary)}
.market-gallery .gallery-empty{grid-column:1/-1;direction:rtl}
.market-gallery .market-orders{margin-top:40px;padding-top:28px;border-top:1px solid var(--color-border);scroll-margin-top:24px}
.market-gallery .gallery-section-head{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:16px;margin:0 0 16px}
.market-gallery .gallery-section-head h2{font-size:23px;font-weight:700;line-height:1.6;margin:0;color:var(--color-text)}
.market-gallery .order-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start}
.market-gallery .order-row.order-tracking{display:block;border:1px solid var(--color-border);border-radius:10px;background:var(--color-surface);padding:20px;box-shadow:none;min-width:0}
.market-gallery .order-tracking-top{display:flex;align-items:center;gap:14px;justify-content:space-between}
.market-gallery .order-tracking-identity{flex:1;min-width:0}.market-gallery .order-tracking-identity strong{font-size:15px;font-weight:700;margin:0 0 5px;overflow-wrap:anywhere}
.market-gallery .order-meta{font-size:12px;color:var(--color-text-muted)}.market-gallery #ordersUpdatedAt{display:block;margin-top:10px}
.market-gallery .order-tracking-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px;flex:none;max-width:48%}
.market-gallery .order-status{white-space:normal;font-size:11px;padding:5px 8px;border-radius:5px;background:var(--color-surface-subtle);color:var(--color-primary);font-weight:600}
.market-gallery .order-tracking-actions .market-btn{font-size:12px;padding:7px 12px}
.market-gallery .order-tracking-disclosure{margin-top:6px}.market-gallery .order-tracking-disclosure>summary{font-size:12px;color:var(--color-primary);cursor:pointer;min-height:44px;align-content:center}
.market-gallery .order-tracking-detail{display:grid;gap:12px;border-top:1px solid var(--color-border);padding-top:14px}
.market-gallery .order-tracking-detail p{margin:0;font-size:12px;line-height:1.8;color:var(--color-text-muted)}.market-gallery .order-tracking-detail .order-progress-eta{color:var(--color-primary);font-weight:600}
.market-gallery .order-steps{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:0;padding:0;list-style:none}
.market-gallery .order-steps li{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--color-text-muted)}.market-gallery .order-step-marker{display:grid;place-items:center;flex:none;width:24px;height:24px;border:1px solid var(--color-border);border-radius:50%}
.market-gallery .order-steps li.complete .order-step-marker{background:var(--color-primary);color:var(--color-surface);border-color:var(--color-primary)}.market-gallery .order-steps li.current{color:var(--color-primary);font-weight:700}.market-gallery .order-steps li.current .order-step-marker{border-color:var(--color-primary)}
.market-gallery .order-export-progress{height:6px;border-radius:6px;background:var(--color-surface-subtle);overflow:hidden}.market-gallery .order-export-progress-fill{display:block;height:100%;background:var(--color-primary)}
.market-gallery .gallery-orders-prompt{grid-column:1/-1;background:var(--color-surface);border:1px solid var(--color-border);border-radius:10px;padding:22px}
.market-gallery .gallery-footer{background:transparent;display:flex;justify-content:space-between;gap:16px;border:0;padding:24px 0;margin-top:20px;font-size:12px;color:var(--color-text-muted)}
.market-gallery :is(.market-dialog,.market-file-preview-dialog){direction:rtl;background:var(--color-surface);color:var(--color-text);border-color:var(--color-border)}
.market-gallery .market-shell :is(a,button,summary,input,select):focus-visible{outline:2px solid var(--color-focus);outline-offset:3px}
@media(max-width:1050px){.market-gallery .market-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.market-gallery .gallery-sort>span{display:none}.market-gallery .gallery-toolbar{gap:12px}.market-gallery .gallery-filters button{padding-inline:12px}}
@media(max-width:760px){html body.market-gallery .market-shell{width:calc(100% - 32px);margin-top:24px}.market-gallery .gallery-toolbar{gap:10px}.market-gallery .marketplace-header-search{flex-basis:100%}.market-gallery .gallery-sort{margin-inline-start:auto}.market-gallery .order-list{grid-template-columns:1fr}.market-gallery .market-card-body{padding:16px}.market-gallery .market-card-foot{grid-template-columns:1fr 1fr}.market-gallery .gallery-card-price{grid-column:1/-1}.market-gallery .gallery-footer{flex-direction:column;gap:8px}}
@media(max-width:600px){.market-gallery .market-heading{align-items:flex-start;gap:12px;margin-bottom:20px}.market-gallery .market-heading h1{font-size:25px}.market-gallery .market-heading p{font-size:12px;max-width:225px}.market-gallery .market-orders-link{font-size:12px;padding:8px 12px}.market-orders-link svg{display:none}.market-gallery .market-filter-panel{padding:12px}.market-gallery .gallery-toolbar{gap:8px}.market-gallery .gallery-filters{flex:1}.market-gallery .gallery-filters button{flex:1;padding-inline:9px}.market-gallery .gallery-sort select{width:135px;font-size:11px;padding-inline:6px}.market-gallery .marketplace-subjects{gap:4px;margin-top:10px}.market-gallery .marketplace-subjects button{padding-inline:11px;min-height:44px;font-size:12px}.market-gallery .market-grid{grid-template-columns:1fr;gap:18px}.market-gallery .market-card-body{padding:18px}.market-gallery .market-card-foot{grid-template-columns:minmax(0,1fr) auto auto}.market-gallery .gallery-card-price{grid-column:auto}.market-gallery .market-card h3{font-size:20px}.market-gallery .gallery-results-bar{font-size:11px;gap:8px}.market-gallery .gallery-results-bar .gallery-text-link{font-size:11px}.market-gallery .market-orders{margin-top:30px;padding-top:24px}.market-gallery .order-row.order-tracking{padding:16px}}
@media(max-width:360px){.market-gallery .gallery-sort{width:100%;margin:0}.market-gallery .gallery-sort>span{display:block}.market-gallery .gallery-sort select{width:auto;max-width:none;flex:1}.market-gallery .market-card-foot{grid-template-columns:1fr 1fr}.market-gallery .gallery-card-price{grid-column:1/-1}.market-gallery .order-tracking-top{align-items:flex-start;flex-direction:column}.market-gallery .order-tracking-actions{max-width:none;justify-content:flex-start}}
@media(prefers-reduced-motion:reduce){.market-gallery *{transition:none!important;scroll-behavior:auto!important}}

/* Existing purchase formatter geometry and controls. */
.market-question-preview-title{margin:0 0 12px;font-size:17px}
.market-format-note,.market-extra-format{grid-column:1/-1;min-width:0}
.market-format-note{font-size:12px;font-weight:400;line-height:1.8;color:var(--color-text-muted);margin:0}
.market-extra-format{display:grid;gap:10px}
.market-format-section{border:1px solid var(--color-border);border-radius:8px;background:var(--color-surface);min-width:0}
.market-format-section>summary{padding:13px 12px;cursor:pointer;font-weight:700;line-height:1.7}
.market-format-section>summary:focus-visible{outline:2px solid var(--color-focus);outline-offset:2px}
.market-format-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:0 12px 14px;min-width:0}
.market-format-fields label{font-size:12px;min-width:0}.market-format-fields input,.market-format-fields select{min-width:0;max-width:100%}
.market-form .market-format-fields input[type=color]{height:44px;padding:5px;cursor:pointer}
.market-format-fields input:disabled{opacity:.5}.market-format-fields>p{grid-column:1/-1}
@media(min-width:900px){#purchaseDialog .market-paper-controls{position:sticky;top:16px}}
@media(max-width:400px){.market-format-fields{grid-template-columns:1fr}}
#purchaseDialog .customize-grid{align-items:start}
#purchaseDialog .market-sample{margin:0 0 16px;padding:10px}
#purchaseDialog .market-sample img{width:100%;max-height:none}
#purchaseDialog .market-sample[aria-busy=true]{opacity:.65}

.bank-lessons{display:grid;gap:12px;padding-inline-start:0;list-style:none}.bank-lessons li{display:flex;align-items:end;gap:8px;min-width:0}.bank-lessons label{flex:1;min-width:0;overflow-wrap:anywhere}.bank-lessons input{width:100%;min-width:0}.bank-lessons button{min-height:44px}#bankOptions[hidden]{display:none}
#questionBankControls{display:block}#questionBankControls>.market-check{margin-block:12px}#bankOptions .market-format-fields{padding:12px 0}#bankOptions>.market-check{margin-block:12px}
@media(max-width:540px){.bank-lessons li{flex-wrap:wrap}.bank-lessons label{flex-basis:100%}}

#bankRandomOptions{margin-block:12px}#bankRandomOptions[hidden]{display:none}.question-picker{max-width:1000px}.question-picker-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.question-picker-card{min-width:0;border:1px solid var(--color-border,#b9c9dc);border-radius:8px;padding:12px}.question-picker-card label{display:flex;gap:8px;align-items:center;font-weight:700}.question-picker-card img{width:100%;height:auto;max-height:340px;object-fit:contain;background:#fff}.question-picker-drop{display:flex;flex-wrap:wrap;gap:12px;padding:16px;border:2px dashed var(--color-border,#7895b5);border-radius:8px}.question-picker-card[draggable=true]{cursor:grab}@media(max-width:800px){.question-picker-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:500px){.question-picker-grid{grid-template-columns:1fr}}

.question-picker .market-actions{margin-block-start:12px;align-items:center;flex-wrap:wrap}

.question-preview-zoom{display:block;width:100%;padding:0;border:0;background:transparent;cursor:zoom-in}.question-preview-expanded{grid-column:1/-1}.question-preview-expanded img{max-height:none}.question-preview-expanded .question-preview-zoom{cursor:zoom-out}
