/* XD_TELEPHONE_DRAW_V1 — أدوات رسم موسّعة + صفحة تشفيف تحت الرسمة */
.xd-draw-toolbar{display:flex;align-items:center;gap:7px;flex-wrap:wrap;padding:0 0 10px}
.xd-tgroup{display:flex;align-items:center;gap:4px;padding:4px;border:1px solid rgba(255,255,255,.07);border-radius:12px;background:#171717}
.xd-tgroup>b{padding:0 5px;font-size:.44rem;color:#6f6f78;font-weight:900;white-space:nowrap}
.xd-tbtn{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-width:32px;height:32px;padding:0 8px;border:1px solid transparent;border-radius:9px;background:#1f1f1f;color:#c9c9d1;font:900 .53rem Cairo,sans-serif;cursor:pointer;transition:.15s;white-space:nowrap}
.xd-tbtn:hover{background:#282828;color:#fff}
.xd-tbtn.active{border-color:rgba(244,114,182,.55);background:rgba(244,114,182,.12);color:#f9a8d4}
.xd-tbtn:disabled{opacity:.32;cursor:not-allowed}
.xd-tbtn i{font-style:normal;font-size:.8rem;line-height:1}

/* تبويب الصفحتين: الأساس / التشفيف */
.xd-pages{padding:3px;border-radius:12px;background:#131313;border-color:rgba(255,255,255,.09)}
.xd-pagebtn{min-width:auto;height:32px;padding:0 11px;border-radius:9px;background:transparent;color:#8b8b95;font-weight:900}
.xd-pagebtn.active{background:#2a2a2a;color:#fff;border-color:rgba(255,255,255,.12)}
.xd-pagebtn[data-page="trace"].active{background:rgba(34,211,238,.14);border-color:rgba(34,211,238,.45);color:#67e8f9}

.xd-swatch{width:26px;height:26px;min-width:26px;padding:0;border-radius:8px;background:var(--c);border:2px solid transparent;box-shadow:inset 0 0 0 1px rgba(255,255,255,.16);cursor:pointer;transition:.13s}
.xd-swatch:hover{transform:translateY(-1px)}
.xd-swatch.active{border-color:#fff;transform:scale(1.1)}
.xd-pick{position:relative;overflow:hidden;width:26px;height:26px;min-width:26px;padding:0;border-radius:8px;border:1px dashed rgba(255,255,255,.3);background:conic-gradient(#ef4444,#f59e0b,#22c55e,#22d3ee,#3b82f6,#a855f7,#ef4444);cursor:pointer}
.xd-pick input{position:absolute;inset:-6px;width:200%;height:200%;opacity:0;cursor:pointer;border:0;padding:0}

.xd-size{width:104px;height:22px;accent-color:#f472b6;cursor:pointer;background:transparent}
.xd-size-dot{display:grid;place-items:center;width:30px;height:30px;border-radius:8px;background:#0f0f0f}
.xd-size-dot i{display:block;border-radius:999px;background:#e9e9ee}
.xd-size-val{min-width:22px;text-align:center;font:900 .5rem 'JetBrains Mono',monospace;color:#8b8b95}

.xd-trace-strength{width:74px;height:22px;accent-color:#22d3ee;cursor:pointer;background:transparent}

/* طبقات اللوحة */
.canvas-wrap{position:relative}
.canvas-wrap.xd-stack canvas{position:absolute;inset:0;width:100%;height:100%;display:block;background:transparent;touch-action:none}
.canvas-wrap.xd-stack .xd-layer-trace{z-index:1;opacity:var(--trace-op,.4)}
.canvas-wrap.xd-stack .xd-layer-base{z-index:2}
.canvas-wrap.xd-stack .xd-layer-ghost{z-index:3;pointer-events:none}
.canvas-wrap.xd-stack.trace-hidden .xd-layer-trace{opacity:0}
.canvas-wrap.xd-stack.on-trace{box-shadow:inset 0 0 0 2px rgba(34,211,238,.5)}
.canvas-wrap.xd-stack.on-trace .xd-layer-trace{opacity:calc(var(--trace-op,.4) + .35)}
.xd-page-flag{position:absolute;z-index:4;top:8px;right:8px;padding:4px 9px;border-radius:999px;background:rgba(12,12,12,.72);backdrop-filter:blur(8px);color:#cbd5e1;font:900 .45rem Cairo,sans-serif;pointer-events:none;transition:.18s}
.canvas-wrap.xd-stack.on-trace .xd-page-flag{background:rgba(8,51,68,.82);color:#67e8f9}
.canvas-wrap.xd-stack .canvas-locked{z-index:9}
.xd-cursor-none{cursor:none!important}
.xd-brush-ring{position:absolute;z-index:8;border-radius:999px;border:1px solid rgba(0,0,0,.55);box-shadow:0 0 0 1px rgba(255,255,255,.65);pointer-events:none;transform:translate(-50%,-50%);opacity:0;transition:opacity .12s}
.canvas-wrap.xd-stack:hover .xd-brush-ring{opacity:1}

/* وضع ملء الشاشة للرسم */
body.xd-draw-full{overflow:hidden}
body.xd-draw-full .drawing-shell.xd-full{position:fixed;inset:0;z-index:120;margin:0;border-radius:0;border:0;background:#101010;padding:10px;display:flex;flex-direction:column;gap:8px}
body.xd-draw-full .drawing-shell.xd-full .canvas-wrap{width:min(100%,calc((100vh - 104px) * 1.5));width:min(100%,calc((100dvh - 104px) * 1.5));aspect-ratio:3/2;margin:auto}
body.xd-draw-full .drawing-shell.xd-full .xd-draw-toolbar{padding-bottom:0}

@media(max-width:820px){
 .xd-draw-toolbar{gap:5px}
 .xd-tgroup{gap:3px;padding:3px;border-radius:10px}
 .xd-tbtn{min-width:30px;height:30px;padding:0 6px;font-size:.5rem}
 .xd-size{width:78px}
 .xd-swatch,.xd-pick{width:24px;height:24px;min-width:24px}
 .xd-tgroup>b{display:none}
}
@media(max-width:520px){
 .xd-draw-toolbar{gap:4px}
 .xd-size{width:60px}
 .xd-trace-strength{width:56px}
 .xd-size-dot,.xd-size-val{display:none}
}
/* /XD_TELEPHONE_DRAW_V1 */

/* XD_TELEPHONE_REVEAL_V1 — عرض رسومات طور تعدد وحدة وحدة */
.reveal-box{max-width:1040px;margin:0 auto 26px;display:grid;gap:12px}
.reveal-stage{position:relative;display:grid;place-items:center;aspect-ratio:3/2;border:1px solid rgba(255,255,255,.08);border-radius:22px;background:#fff;overflow:hidden;box-shadow:0 26px 70px rgba(0,0,0,.34)}
.reveal-stage img{width:100%;height:100%;object-fit:contain;display:block}
.reveal-stage.pop{animation:xdRevealPop .42s cubic-bezier(.18,.85,.28,1) both}
@keyframes xdRevealPop{from{opacity:0;transform:scale(.955) translateY(12px)}to{opacity:1;transform:none}}
.reveal-empty{position:absolute;inset:0;display:grid;place-items:center;background:#f4f4f0;color:#8a8a90;font:900 .78rem Cairo,sans-serif}
.reveal-bar{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:12px}
.reveal-person{display:flex;align-items:center;justify-content:center;gap:10px;min-width:0}
.reveal-person img{width:48px;height:48px;border-radius:14px;object-fit:cover;border:1px solid rgba(255,255,255,.1)}
.reveal-person span{display:grid;line-height:1.35;min-width:0}
.reveal-person small{font:800 .5rem 'JetBrains Mono',monospace;color:#7a7a82}
.reveal-person b{font-size:.86rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.reveal-bar .primary-btn{min-width:130px}
.reveal-bar .ghost-btn:disabled{opacity:.35;cursor:not-allowed}
.reveal-all{justify-self:center;padding:9px 18px}
@media(max-width:640px){
 .reveal-bar{grid-template-columns:1fr 1fr}
 .reveal-person{grid-column:1/-1;grid-row:1}
 .reveal-bar>button{grid-row:2}
 .reveal-stage{border-radius:16px}
 .reveal-bar .primary-btn{min-width:0}
}
/* /XD_TELEPHONE_REVEAL_V1 */

/* XD_DRAW_FULLSCREEN_PORTAL_V78 */
body.xd-draw-full{overflow:hidden!important}
body.xd-draw-full>.drawing-shell.xd-full{position:fixed!important;inset:0!important;z-index:2147482500!important;width:auto!important;height:100dvh!important;max-width:none!important;max-height:none!important;margin:0!important;padding:10px!important;border:0!important;border-radius:0!important;box-sizing:border-box!important;background:#101010!important;display:flex!important;flex-direction:column!important;gap:8px!important;overflow:hidden!important;transform:none!important}
body.xd-draw-full>.drawing-shell.xd-full>.xd-draw-toolbar{flex:0 0 auto!important;width:100%!important;max-width:100%!important;margin:0!important;padding-bottom:0!important;overflow-x:auto!important;overflow-y:hidden!important;flex-wrap:nowrap!important;scrollbar-width:none}
body.xd-draw-full>.drawing-shell.xd-full>.xd-draw-toolbar::-webkit-scrollbar{display:none}
body.xd-draw-full>.drawing-shell.xd-full>.canvas-wrap{flex:0 1 auto!important;width:min(calc(100vw - 20px),calc((100dvh - 74px) * 1.5))!important;height:auto!important;max-width:calc(100vw - 20px)!important;max-height:calc(100dvh - 74px)!important;aspect-ratio:3/2!important;margin:auto!important;align-self:center!important}
body.xd-draw-full>.drawing-shell.xd-full>.autosave-row{flex:0 0 auto!important;margin:0!important}
@media(max-width:700px){body.xd-draw-full>.drawing-shell.xd-full{padding:7px!important;gap:6px!important}body.xd-draw-full>.drawing-shell.xd-full>.canvas-wrap{width:min(calc(100vw - 14px),calc((100dvh - 68px) * 1.5))!important;max-width:calc(100vw - 14px)!important;max-height:calc(100dvh - 68px)!important}}
/* /XD_DRAW_FULLSCREEN_PORTAL_V78 */
