/* ==========================================================================
   assemble.css — «لوحة تُبنى أمامك»: a swarm of agent cursors assembles a page.
   Pairs with assemble.js (PNAssemble.run). 09-kufi language: paper / ink /
   flag red, radius 0 except pills and dots. Overlay only — never takes clicks.
   ========================================================================== */
:root{
  --pna-sel:#6B6B6B;          /* selection lines + «W × H» tag: grey (09-kufi) */
  --pna-adj:var(--action, #1739A8);
  --pna-skel:rgba(11,11,11,.07);
  --pna-ink:#0B0B0B;
  --pna-font:"Readex Pro","Noto Kufi Arabic",system-ui,sans-serif;
}

/* hidden-until-built. !important so page transitions can't leak through */
.pna-h{ opacity:0!important; transition:none!important; animation:none!important; }
.pna-r{ animation:pna-in .3s cubic-bezier(.2,.7,.2,1) both; }
@keyframes pna-in{ from{ opacity:0; } to{ opacity:1; } }

/* overlay in document coordinates, never interactive */
.pna-layer{ position:absolute; left:0; top:0; width:0; height:0; z-index:2147483000; pointer-events:none; direction:ltr; contain:layout style; }
.pna-layer *{ pointer-events:none; }

/* selection box: four edges + faint fill, all transform-driven */
.pna-box{ position:absolute; left:0; top:0; will-change:transform,opacity; }
.pna-box i{ position:absolute; left:0; top:0; display:block; background:var(--paper-2, #F1F0EC); transform-origin:0 0; will-change:transform; }
.pna-box .e-t,.pna-box .e-b{ height:1.5px; }
.pna-box .e-s,.pna-box .e-e{ width:1.5px; }
.pna-box .fill{ background:var(--paper-2, #F1F0EC); opacity:.06; }
.pna-box.adj i{ background: #E4EDFF; }
.pna-box.adj .fill{ opacity:0; }
.pna-box.adj .e-t,.pna-box.adj .e-b{ height:1.5px; }
.pna-tag{
  position:absolute; left:0; top:0; white-space:nowrap;
  font:600 11px/1 var(--pna-font); color:var(--ink, #0B0B0B); background:var(--paper-2, #F1F0EC);
  padding:3px 5px 3px; border-radius:0; direction:ltr; unicode-bidi:isolate;
  font-feature-settings:"tnum" 1,"lnum" 1; will-change:transform,opacity;
}
.pna-tag.adj{ background: #E4EDFF; }

/* grey skeleton slab for containers */
.pna-skel{ position:absolute; left:0; top:0; background:var(--pna-skel); transform-origin:0 0; will-change:transform,opacity; }
.pna-dark .pna-skel{ background:rgba(255,255,255,.08); }

/* cursors */
.pna-cur{ position:absolute; left:0; top:0; will-change:transform,opacity; }
.pna-cur svg{ display:block; width:16px; height:20px; overflow:visible; filter:drop-shadow(0 1px 1.5px rgba(0,0,0,.28)); }
.pna-cur .x{ position:absolute; left:-8px; top:-8px; width:16px; height:16px; opacity:0; transition:opacity .12s; }
.pna-cur .x::before,.pna-cur .x::after{ content:""; position:absolute; background:currentColor; }
.pna-cur .x::before{ left:7.25px; top:0; width:1.5px; height:16px; }
.pna-cur .x::after{ top:7.25px; left:0; height:1.5px; width:16px; }
.pna-cur.cross .x{ opacity:1; }
.pna-cur.cross svg{ opacity:0; }
.pna-cur svg{ transition:opacity .12s; }
.pna-cur b{
  position:absolute; left:12px; top:16px; display:block; max-width:170px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  font:600 10.5px/1.3 var(--pna-font); color:#fff; padding:1px 6px 2px; opacity:.95;
  direction:rtl; unicode-bidi:isolate;
}
.pna-cur.nolabel b{ display:none; }
/* idle crosshair markers (grey «+» left behind, as in the reference) */
.pna-mark{ position:absolute; left:0; top:0; width:12px; height:12px; color:#9A9A9A; opacity:0; will-change:transform,opacity; }
.pna-mark::before,.pna-mark::after{ content:""; position:absolute; background:currentColor; }
.pna-mark::before{ left:5.5px; top:0; width:1px; height:12px; }
.pna-mark::after{ top:5.5px; left:0; height:1px; width:12px; }

/* HUD pill */
.pna-hud{
  position:fixed; left:50%; bottom:calc(20px + env(safe-area-inset-bottom,0px));
  transform:translate(-50%,0); z-index:2147483001;
  display:flex; align-items:center; gap:14px; direction:rtl;
  min-height:48px; padding:6px 8px 6px 18px; padding-inline-start:12px;
  background:var(--paper-2, #F1F0EC); color:var(--ink, #0B0B0B); border-radius:999px;
  box-shadow:0 10px 30px rgba(0,0,0,.28), 0 2px 6px rgba(0,0,0,.2);
  font:500 15px/1.2 var(--pna-font); white-space:nowrap;
  font-feature-settings:"tnum" 1,"lnum" 1;
  transition:opacity .35s cubic-bezier(.2,.7,.2,1), transform .35s cubic-bezier(.2,.7,.2,1);
  max-width:calc(100vw - 24px);
}
.pna-hud.out{ opacity:0; transform:translate(-50%,16px); pointer-events:none; }
.pna-hud .dots{ display:flex; flex:none; padding-inline-start:4px; }
.pna-hud .dots i{ width:18px; height:18px; border-radius:999px; box-shadow:0 0 0 2px var(--pna-ink); margin-inline-start:-6px; }
.pna-hud .dots i:first-child{ margin-inline-start:0; }
.pna-hud .t{ display:flex; align-items:center; gap:8px; color:#C9C9C9; }
.pna-hud .t b{ color:#fff; font-weight:700; }
.pna-hud .t .sep{ color:#6B6B6B; }
.pna-hud .bar{ width:72px; height:3px; background:var(--paper-2, #F1F0EC); flex:none; position:relative; overflow:hidden; }
.pna-hud .bar i{ position:absolute; inset:0; background:var(--paper-2, #F1F0EC); transform-origin:100% 50%; transform:scaleX(0); }
.pna-hud.done .bar i{ background:#fff; }
.pna-hud button{
  min-height:36px; padding:0 14px; border:0; border-radius:0; cursor:pointer;
  font:700 14px/1 var(--pna-font); color:var(--ink, #0B0B0B); background:var(--paper-2, #F1F0EC);
  transition:background .15s;
}
.pna-hud button:hover{ background:var(--paper-2, #F1F0EC); }
.pna-hud button.x{ min-width:36px; padding:0; font-size:18px; background:transparent; color:#C9C9C9; }
.pna-hud button.x:hover{ background:var(--paper-2, #F1F0EC); color:var(--ink, #0B0B0B); }
.pna-hud button.go{ background: #E4EDFF; }
.pna-hud button.go:hover{ background:#CBDCFF; }
.pna-hud button:focus-visible{ outline:3px solid var(--pna-adj); outline-offset:2px; }
.pna-hud .ok{ width:10px; height:10px; border-radius:999px; background:#fff; flex:none; display:none; }
.pna-hud.done .ok{ display:block; }
.pna-hud.done .dots{ display:none; }

@media (max-width:600px){
  .pna-hud{ gap:8px; font-size:13px; min-height:42px; padding:4px 6px; padding-inline-start:10px; bottom:calc(12px + env(safe-area-inset-bottom,0px)); }
  .pna-hud .bar{ display:none; }
  .pna-hud .dots i{ width:14px; height:14px; }
  .pna-hud button{ min-height:34px; padding:0 10px; font-size:13px; }
  .pna-cur b{ max-width:120px; font-size:10px; }
}
@media (prefers-reduced-motion:reduce){
  .pna-r{ animation:none; }
}
