/* Shared Lineage II client window kit (.claude/rules/l2-ui.md, docs/design/l2-ui-port-2026-11-13.md step 0, catalog
   docs/client-ui-assets.md). Every size is in the client's pixels times --wpx: l2-wnd.js sets it to a whole number of device
   pixels per client pixel, so the client's one-pixel lines stay sharp, and image-rendering keeps them unsmoothed. Positions and
   sizes come from system/interface.xdat and from the client's own screenshot (docs/reference/l2-ui/interlude/), the textures from
   L2UI_CH3 (scripts/l2-ui-assets.py, dist/assets/ui/wnd/). Sharp corners, no radius, gradients, shadows or colours of our own. */
#l2wnd{position:fixed;inset:0;z-index:14;pointer-events:none;overflow:hidden}
.l2w{position:absolute;left:0;top:0;width:calc(var(--ww) * var(--wpx));height:calc(var(--wh) * var(--wpx));pointer-events:auto;
 font:var(--wfont,var(--l2,26px))/var(--wline,normal) var(--l2font);color:#dcdcdc;text-align:left;
 image-rendering:pixelated;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}
.l2w[hidden]{display:none}
.l2w *{box-sizing:border-box}
/* nothing of the world shows through a window (e9 14. 11. 2026 from Daniel's test: the NPCs' titles and names through Edit Crest,
   Clan Info, the test notes and the Status card under them). The client's backs are 170 to 221 opaque (body.png's middle
   16,16,16 at 221, myinfo-back and smallpanel 35,34,35 at 170): under every window of the kit its whole box gets the middle of
   wnd/body.png four times over (99.97 % opaque), the window's own textures on it as before. The box is the window's: its bar and
   its back cover all of it (every texture's corners are opaque), so nothing dark shows where the client draws nothing. */
.l2w{isolation:isolate}
.l2w::before{content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;
 background:url(assets/ui/wnd/body.png) 50% 50%/10000% 10000% no-repeat,url(assets/ui/wnd/body.png) 50% 50%/10000% 10000% no-repeat,
  url(assets/ui/wnd/body.png) 50% 50%/10000% 10000% no-repeat,url(assets/ui/wnd/body.png) 50% 50%/10000% 10000% no-repeat}
/* a piece placed in client pixels (l2-wnd.js at(): --x --y --pw --ph, all four always set on the piece) */
.l2p{position:absolute;left:calc(var(--x) * var(--wpx));top:calc(var(--y) * var(--wpx));width:calc(var(--pw) * var(--wpx));height:calc(var(--ph) * var(--wpx))}
.l2tex{background-repeat:no-repeat;background-position:0 0;background-size:100% 100%}

/* FRAMECTRL: the title bar the client draws over every framed window (unk114 3), FrameBackLeft 16 + FrameBackMid stretched +
   FrameBackRight 16, 20 px high; the title at +21 in rgb(215,221,244), its capitals on rows 8 to 15 (measured in
   interlude-alt-t-01.jpg: centred in the bar they stand 2 px higher, hence top 2), the minimise
   button at the right edge -40 and the close one at -23, both +3 from the top and 15 x 15 */
.l2w-bar{position:absolute;left:0;top:0;width:100%;height:calc(20 * var(--wpx));cursor:default;touch-action:none;
 background:url(assets/ui/wnd/frame-left.png) 0 0/calc(16 * var(--wpx)) 100% no-repeat,
  url(assets/ui/wnd/frame-right.png) 100% 0/calc(16 * var(--wpx)) 100% no-repeat,
  url(assets/ui/wnd/frame-mid.png) calc(16 * var(--wpx)) 0/calc(100% - 32 * var(--wpx)) 100% no-repeat}
.l2w-title{position:absolute;left:calc(21 * var(--wpx));right:calc(44 * var(--wpx));top:calc(2 * var(--wpx));height:calc(20 * var(--wpx));
 line-height:calc(20 * var(--wpx));color:#d7ddf4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none}
.l2w-x,.l2w-min{position:absolute;top:calc(3 * var(--wpx));width:calc(15 * var(--wpx));height:calc(15 * var(--wpx));margin:0;padding:0;
 border:0;border-radius:0;background:url(assets/ui/wnd/close.png) 0 0/100% 100% no-repeat;cursor:pointer;outline:0}
.l2w-x{right:calc(8 * var(--wpx))}
.l2w-x:hover{background-image:url(assets/ui/wnd/close-over.png)}
.l2w-x:active{background-image:url(assets/ui/wnd/close-down.png)}
.l2w-min{right:calc(25 * var(--wpx));background-image:url(assets/ui/wnd/mini.png)}
.l2w-min:hover{background-image:url(assets/ui/wnd/mini-over.png)}
.l2w-min:active{background-image:url(assets/ui/wnd/mini-down.png)}
.l2w.l2w-mini>:not(.l2w-bar){display:none}
.l2w.l2w-mini{height:calc(20 * var(--wpx)) !important}

/* the window's content below the bar; scrolls when the window is taller than the screen (a phone on its side) */
.l2w-body{position:absolute;left:0;top:calc(20 * var(--wpx));width:100%;height:calc(100% - 20 * var(--wpx))}
/* a body of any size where the client has no window of its own: the client's resizable stack of TutorialViewerWnd
   (tutorial_back1 stretched 12 px, tutorial_back2 tiled, tutorial_back3 9 px; wnd/body.png), sliced at its measured edges:
   12 at the top, 9 at the bottom, 7 left and right (columns 7 to 302 and the middle rows are flat, so stretching loses nothing) */
.l2w-frame{border-style:solid;border-width:calc(12 * var(--wpx)) calc(7 * var(--wpx)) calc(9 * var(--wpx));
 border-image:url(assets/ui/wnd/body.png) 12 7 9 fill/calc(12 * var(--wpx)) calc(7 * var(--wpx)) calc(9 * var(--wpx)) stretch}

/* Btn1 (L2UI_CH3 Btn1_normal, _over, _down, _disable), 76 x 23 with a 2 px shadow at the bottom: 4 px left edge, 8 px right edge
   (columns 4 to 67 are flat), any width; the text in the 21 px above the shadow */
.l2-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;min-width:calc(76 * var(--wpx));
 height:calc(23 * var(--wpx));margin:0;padding:0 calc(2 * var(--wpx)) calc(2 * var(--wpx));border:0;border-radius:0;
 border-style:solid;border-width:0 calc(8 * var(--wpx)) 0 calc(4 * var(--wpx));
 border-image:url(assets/ui/wnd/btn1.png) 0 8 0 4 fill/0 calc(8 * var(--wpx)) 0 calc(4 * var(--wpx)) stretch;
 background:none;font:inherit;line-height:1;color:#dcdcdc;white-space:nowrap;cursor:pointer;outline:0;image-rendering:pixelated}
.l2-btn:hover{border-image-source:url(assets/ui/wnd/btn1-over.png)}
.l2-btn:active{border-image-source:url(assets/ui/wnd/btn1-down.png)}
.l2-btn:disabled{border-image-source:url(assets/ui/wnd/btn1-disable.png);color:#808080;cursor:default}

/* TABBUTTON (interface.xdat's TabElement: normalTex normal_tab_on, pushedTex normal_tab, gap 1), 74 x 23: 8 px left and 10 px
   right edge (columns 8 to 63 are flat). The selected tab is the light normal_tab, the others the dark normal_tab_on, which
   glows (normal_tab_on_over) under the mouse; as the client's inventory and chat draw them (interlude-inventory-01.jpg) */
.l2-tabs{display:flex;align-items:flex-end;gap:var(--wpx)}
.l2-tab{display:inline-flex;align-items:center;justify-content:center;min-width:calc(74 * var(--wpx));height:calc(23 * var(--wpx));margin:0;
 padding:0;border:0;border-radius:0;border-style:solid;border-width:0 calc(10 * var(--wpx)) 0 calc(8 * var(--wpx));
 border-image:url(assets/ui/wnd/tab-on.png) 0 10 0 8 fill/0 calc(10 * var(--wpx)) 0 calc(8 * var(--wpx)) stretch;
 background:none;font:inherit;line-height:1;color:#a3a3a3;white-space:nowrap;cursor:pointer;outline:0;image-rendering:pixelated}
.l2-tab:hover{border-image-source:url(assets/ui/wnd/tab-on-over.png)}
.l2-tab[aria-selected="true"]{border-image-source:url(assets/ui/wnd/tab.png);color:#dcdcdc;cursor:default}

/* MainWnd's icon tabs (Button.MainWndTabBack and MainWndTab1..5, normal, On, _over), 45 x 41 each from +12,+25 */
.l2-itab{margin:0;padding:0;border:0;border-radius:0;background-color:transparent;background-repeat:no-repeat;background-size:100% 100%;cursor:pointer;outline:0;
 background-image:var(--n)}
.l2-itab:hover{background-image:var(--o)}
.l2-itab[aria-selected="true"]{background-image:var(--s)}

/* SCROLLBAR (ScrollBarBack tiled, the up and down buttons 15 x 15, the thumb's top, centre and bottom 15 x 8, each with over and
   down); the native bar hidden, l2Scroll() moves the view */
.l2-scroll{position:relative;overflow:hidden}
.l2-scroll-view{position:absolute;left:0;top:0;bottom:0;right:calc(15 * var(--wpx));overflow-x:hidden;overflow-y:auto;scrollbar-width:none;overscroll-behavior:contain}
.l2-scroll-view::-webkit-scrollbar{display:none}
.l2-scroll-bar{position:absolute;right:0;top:0;bottom:0;width:calc(15 * var(--wpx));
 background:url(assets/ui/wnd/scroll-back.png) 0 0/calc(14 * var(--wpx)) calc(8 * var(--wpx)) repeat-y}
.l2-scroll-bar[hidden]{display:none}
.l2-scroll-up,.l2-scroll-down{position:absolute;left:0;width:calc(15 * var(--wpx));height:calc(15 * var(--wpx));margin:0;padding:0;border:0;
 border-radius:0;background:url(assets/ui/wnd/scroll-up.png) 0 0/100% 100% no-repeat;cursor:pointer;outline:0}
.l2-scroll-up{top:0}
.l2-scroll-up:hover{background-image:url(assets/ui/wnd/scroll-up-over.png)}
.l2-scroll-up:active{background-image:url(assets/ui/wnd/scroll-up-down.png)}
.l2-scroll-down{bottom:0;background-image:url(assets/ui/wnd/scroll-down.png)}
.l2-scroll-down:hover{background-image:url(assets/ui/wnd/scroll-down-over.png)}
.l2-scroll-down:active{background-image:url(assets/ui/wnd/scroll-down-down.png)}
.l2-scroll-thumb{position:absolute;left:0;width:calc(15 * var(--wpx));cursor:pointer;touch-action:none;
 background:url(assets/ui/wnd/thumb-top.png) 0 0/100% calc(8 * var(--wpx)) no-repeat,
  url(assets/ui/wnd/thumb-bottom.png) 0 100%/100% calc(8 * var(--wpx)) no-repeat,
  url(assets/ui/wnd/thumb-center.png) 0 0/100% calc(8 * var(--wpx)) repeat-y;min-height:calc(16 * var(--wpx))}
.l2-scroll-thumb:hover{background-image:url(assets/ui/wnd/thumb-top-over.png),url(assets/ui/wnd/thumb-bottom-over.png),url(assets/ui/wnd/thumb-center-over.png)}
.l2-scroll-thumb.drag{background-image:url(assets/ui/wnd/thumb-top-down.png),url(assets/ui/wnd/thumb-bottom-down.png),url(assets/ui/wnd/thumb-center-down.png)}
/* Controls built straight from interface.xdat (l2-xdat.js): each at its xdat place and size (.l2p), every texture the client's own
   pixels at the top left of its power-of-two canvas (--bs: the canvas's size times --wpx, l2-xdat.js), the text one 12 px row as
   the client's TextBox draws it (at the top of its box). */
.xd[hidden]{display:none !important}
.xd-wnd,.xd-tex{image-rendering:pixelated}
.xd-text{line-height:calc(12 * var(--wpx));white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#dcdcdc}
.xd-text.xd-auto{width:auto;overflow:visible}
.xd-btn,.xd-tab,.xd-slot,.xd-check{margin:0;padding:0;border:0;border-radius:0;outline:0;font:inherit;color:#dcdcdc;
 background:transparent no-repeat 0 0;background-size:var(--bs,100% 100%);image-rendering:pixelated;cursor:pointer;
 -webkit-tap-highlight-color:transparent}
/* Btn1: normalTex, pushedTex while pressed (xdat gives these buttons no highlight), the text centred over its 2 px shadow;
   a button the game cannot act on yet the client's Btn1_disable (wnd/btn1-disable.png, 76 x 23) */
.xd-btn{display:flex;align-items:center;justify-content:center;padding-bottom:calc(2 * var(--wpx));white-space:nowrap;overflow:hidden;
 background-image:var(--n)}
.xd-btn:hover{background-image:var(--o)}
.xd-btn:active{background-image:var(--d)}
.xd-btn:disabled{background:url(assets/ui/wnd/btn1-disable.png) 0 0/calc(76 * var(--wpx)) calc(23 * var(--wpx)) no-repeat;color:#808080;cursor:default}
/* a Tab's buttons: normalTex, the selected one pushedTex (MainWnd's icons, MagicSkillWnd's Active and Passive) */
.xd-tab{display:flex;align-items:center;justify-content:center;white-space:nowrap;color:#a3a3a3;background-image:var(--n)}
.xd-tab[aria-selected="true"]{background-image:var(--s,var(--n));color:#dcdcdc;cursor:default}
/* ItemWindow: the icons over the slots the page's back has drawn in, the window scrolls past its rows */
.xd-items{display:grid;align-content:start;gap:calc(var(--gy) * var(--wpx)) calc(var(--gx) * var(--wpx));overflow:hidden auto;
 scrollbar-width:none;overscroll-behavior:contain}
.xd-items::-webkit-scrollbar{display:none}
.xd-slot{position:relative;width:calc(var(--iw) * var(--wpx));height:calc(var(--ih) * var(--wpx));background-size:100% 100%;image-rendering:auto}
.xd-slot.xd-still{cursor:default}
/* a slot whose action or skill cannot now (the Actions page, l2-status.js): greyed as the client draws an unusable icon; its tip says why */
.xd-slot.off{filter:grayscale(1) brightness(.55);cursor:default}
.xd-slot:hover{outline:var(--wpx) solid #b09b79;outline-offset:calc(-1 * var(--wpx))}
.xd-slot-n{position:absolute;right:var(--wpx);bottom:0;font:inherit;font-weight:400;line-height:1;color:#dcdcdc;text-shadow:var(--wpx) var(--wpx) 0 #000}
/* ListCtrl: the column heads over the rows, one 16 px row each (ClanWnd's members) */
.xd-list{display:flex;flex-direction:column;overflow:hidden}
.xd-list-head,.xd-list-row{display:grid;flex-shrink:0;height:calc(16 * var(--wpx));line-height:calc(16 * var(--wpx));white-space:nowrap}
.xd-list-head{color:#a3a3a3}
.xd-list-head>span,.xd-list-row>span{overflow:hidden;text-overflow:ellipsis;padding:0 calc(3 * var(--wpx))}
.xd-list-body{flex:1;overflow:hidden auto;scrollbar-width:none;overscroll-behavior:contain}
.xd-list-body::-webkit-scrollbar{display:none}
.xd-list-row{color:#dcdcdc}
.xd-list-row[data-tip],.xd-list-row:hover{cursor:default}
/* The controls of an NPC's HTML (nwindow.dll NCNPCHtmlViewer, UI port step 6, l2-npc.js; scripts/l2-npc-tex.py): a <button> without
   its own back is L2UI.control.DefaultButton, _click while pressed (wnd/html-btn.png, 67 x 19 of its 128 x 32 canvas: 4 px left and
   5 px right bevel, the rows a fixed gradient, so it stretches across); an <edit> is NCEditBox's L2UI_CH3.Etc.inputbox1 | 2 | 3
   (wnd/edit.png 24 x 17: 8 px ends, the middle flat), _disable when it is off, 120 wide as the datapack's <edit width=120> */
.l2-hbtn{display:inline-flex;align-items:center;justify-content:center;min-width:calc(67 * var(--wpx));height:calc(19 * var(--wpx));margin:0;
 padding:0 calc(2 * var(--wpx));border:0;border-radius:0;border-style:solid;border-width:0 calc(5 * var(--wpx)) 0 calc(4 * var(--wpx));
 border-image:url(assets/ui/wnd/html-btn.png) 0 5 0 4 fill/0 calc(5 * var(--wpx)) 0 calc(4 * var(--wpx)) stretch;
 background:none;box-shadow:none;font:inherit;line-height:1;color:#dcdcdc;white-space:nowrap;cursor:pointer;outline:0;image-rendering:pixelated}
.l2-hbtn:active,.l2-hbtn[aria-pressed="true"]{border-image-source:url(assets/ui/wnd/html-btn-down.png)}
.l2-hbtn:disabled,.l2-hbtn[aria-disabled="true"]{color:#808080;cursor:default}
.l2-edit{display:block;width:calc(120 * var(--wpx));height:calc(17 * var(--wpx));margin:0;padding:0 calc(4 * var(--wpx));border:0;border-radius:0;
 border-image:url(assets/ui/wnd/edit.png) 0 8 0 8 fill/0 calc(8 * var(--wpx)) 0 calc(8 * var(--wpx)) stretch;
 background:none;box-shadow:none;font:inherit;line-height:calc(17 * var(--wpx));color:#dcdcdc;caret-color:#dcdcdc;outline:0;
 image-rendering:pixelated;user-select:text;-webkit-user-select:text}
.l2-edit::placeholder{color:#808080;opacity:1}
.l2-edit:disabled{border-image-source:url(assets/ui/wnd/edit-disable.png);color:#808080}

/* GM and petition windows' controls */
.l2w .l2-edit.l2p{width:calc(var(--pw) * var(--wpx));height:calc(var(--ph) * var(--wpx))}
.l2w .xd-multi{resize:none;white-space:pre-wrap;line-height:var(--wline);overflow:auto;padding:calc(3 * var(--wpx)) calc(4 * var(--wpx));border:var(--wpx) solid #808080;background:#101010;border-image:none}
.l2w .xd-lines,.l2w .xd-html{position:absolute}
.xd-line{white-space:pre-wrap;overflow-wrap:anywhere;color:#dcdcdc;min-height:var(--wline)}
.xd-check{display:flex;align-items:center;gap:calc(3 * var(--wpx));white-space:nowrap;line-height:calc(12 * var(--wpx))}
/* the client's own check box and radio button (scripts/l2-check-tex.py: L2UI.CheckBox 12 x 12 and L2UI_CH3.radiobutton1/2 11 x 11
   at the top left of their 16 x 16 canvas), 1:1 in client px; greyed while disabled */
.xd-check::before{content:'';display:block;flex:none;width:calc(12 * var(--wpx));height:calc(12 * var(--wpx));
 background:url(assets/ui/xdat/tex/checkbox.png) 0 0/calc(16 * var(--wpx)) calc(16 * var(--wpx)) no-repeat;image-rendering:pixelated}
.xd-check[aria-pressed="true"]::before{background-image:url(assets/ui/xdat/tex/checkbox_checked.png)}
.xd-check:disabled::before{background-image:url(assets/ui/xdat/tex/checkbox_unable.png)}
.xd-check[aria-pressed="true"]:disabled::before{background-image:url(assets/ui/xdat/tex/checkbox_checked_unable.png)}
.xd-radio::before,.xd-radio:disabled::before{background-image:url(assets/ui/xdat/tex/radiobutton1.png)}
.xd-radio[aria-checked="true"]::before{background-image:url(assets/ui/xdat/tex/radiobutton2.png)}
.xd-combo{z-index:2}
.xd-combo>.l2-edit{width:100%;height:100%;cursor:pointer;text-align:left}
.xd-combo-list{position:absolute;left:0;top:100%;width:100%;background:#101010;border:var(--wpx) solid #808080}
.xd-combo-list[hidden]{display:none}
.xd-combo-list>.l2-hbtn{display:flex;width:100%;text-align:left;justify-content:flex-start}
.l2-html{color:#dcdcdc;overflow-wrap:anywhere}
.l2-html a{color:#6699ff;text-decoration:none;cursor:pointer}
.l2-html a:hover{text-decoration:underline}
.l2-html .level,.l2-html font[color="LEVEL"]{color:#ffcc00}
.l2-html p{margin:0 0 calc(6 * var(--wpx))}
.l2-htmlwnd .npc-view a{color:#6699ff;text-decoration:none;cursor:pointer}
.l2-htmlwnd .npc-view .level{color:#ffcc00}
.l2-htmlwnd .npc-view .l2-edit{margin:calc(3 * var(--wpx)) 0}
.l2-htmlwnd .npc-view p{margin:0 0 calc(6 * var(--wpx))}
.l2-htmlwnd .npc-view .l2-hbtn{margin:calc(2 * var(--wpx))}
/* cbui91's face fills all 18 rows of the GM buttons, so their text needs no lift (Btn1's 2 px is for its shadow) */
.gm-client .xd-btn{padding-bottom:0}
.gm-client .xd-btn:disabled{background-image:var(--n);background-size:var(--bs);color:#808080}
.gm-dialog .l2w-bar{display:none}
.gm-dialog .l2w-body{top:0;height:100%}
.gm-dialog .l2w-in{margin-top:0 !important}
.gm-dialog [data-xd="DialogText"]{white-space:pre-wrap;overflow-wrap:anywhere;height:calc(50 * var(--wpx))}

#gmClanWnd .xd-list-row{cursor:default}

.l2-htmlwnd .npc-html{position:absolute}

.petition-send{display:none}

/* the short survey after login (survey-ui.js, PetitionFeedBackWnd's back): the intro and the second question wrap and sit on the
   middle of their box as the one-line question and the edit box's label do, the last line holds its label and the edit box side by
   side, a check box resting at three picked greys */
.survey-wnd [data-xd="Intro"],.survey-wnd [data-xd="WantLabel"]{display:flex;align-items:center;white-space:normal;text-overflow:clip;line-height:var(--wline)}
.survey-wnd [data-xd="DirLabel"],.survey-line>[data-xd="MoreLabel"]{display:flex;align-items:center}
.survey-line{display:flex;align-items:center;gap:calc(4 * var(--wpx))}
.survey-line>.l2p{position:static;flex:none}
.l2w .survey-line>.l2-edit.l2p{flex:1;width:auto;min-width:0}
.survey-wnd .xd-check:disabled{color:#808080;cursor:default}
