/* Compact item windows (owner 2026-11-11: "the item windows waste space; phones are small, make them tight and easy").
   Market / storage detail popup (.mk-pop), the bag item popup (#panel-layer .item-popup-dialog) and the sell grid. */

/* market sell tab: only the items you carry, tap one to open it */
.mk-selltip { margin: 2px 0 6px; font-size: 12px; }
.mk-sellgrid { grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 6px; }
.cell.off { opacity: .38; filter: grayscale(.7); }

/* detail popup: icon in the header, card scrolls, form and buttons stay visible */
.mk-pop > header { justify-content: flex-start; gap: 8px; padding: 8px 10px 6px; }
.mk-pop > header b { flex: 1; min-width: 0; font-size: 15px; }
.mk-pop .mk-pop-ic { width: 34px; height: 34px; object-fit: contain; flex: none; }
.mk-pop .x { width: 36px; height: 36px; font-size: 15px; }
.mk-pop .item-popup-label:empty { display: none; }
.mk-pop .item-popup-content { padding: 0 12px 6px; }
.mk-pop > .mk-info { flex-shrink: 0; margin: 0; padding: 8px 12px; border-top: 1px solid var(--line); }
.mk-pop .mk-verdict { margin: 2px 0; font-size: 12px; }
.mk-sellform { display: grid; grid-template-columns: 1fr 1.6fr; gap: 4px 10px; align-items: end; }
.mk-sellform label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted, #7a6a58); }
.mk-sellform label:only-of-type { grid-column: 1 / -1; }
.mk-sellform input { width: 100%; box-sizing: border-box; min-height: 40px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 16px; /* 16px keeps iOS from zooming */ }
.mk-sellform small { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted, #7a6a58); }
.mk-pop .item-popup-actions { display: flex; gap: 8px; padding: 8px 12px; }
.mk-pop .item-popup-actions .btn { flex: 1; min-height: 42px; margin: 0; }

/* every item popup on a phone: tighter header, card and buttons */
html[data-ui="mobile"] .item-popup-overlay { padding: 6px; align-items: end; }
html[data-ui="mobile"] .item-popup-dialog { max-height: calc(100dvh - 12px); border-radius: 14px; font-size: 13px; }
html[data-ui="mobile"] .item-popup-dialog:not(.has-comparison) { width: min(400px, calc(100vw - 12px)); }
html[data-ui="mobile"] .item-popup-dialog > header { padding: 6px 8px 4px 12px; }
html[data-ui="mobile"] .item-popup-dialog > header b { font-size: 14px; }
html[data-ui="mobile"] .item-popup-dialog .x { width: 34px; height: 34px; font-size: 14px; }
html[data-ui="mobile"] .item-popup-content { padding: 0 10px 6px; }
html[data-ui="mobile"] .item-popup-cards > article { padding: 6px 8px; }
html[data-ui="mobile"] .item-popup-label { min-height: 26px; }
html[data-ui="mobile"] .item-popup-label img { width: 28px; height: 28px; }
html[data-ui="mobile"] .item-popup-dialog .itemcard h4 { font-size: 13.5px !important; margin: 2px 0; }
html[data-ui="mobile"] .item-popup-dialog .itemcard .stats { font-size: 12px; line-height: 1.45; }
html[data-ui="mobile"] .item-popup-actions { padding: 6px 8px; }
html[data-ui="mobile"] .item-popup-actions .itemcard-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
html[data-ui="mobile"] .item-popup-actions .btn { min-height: 40px; padding: 4px 8px; font-size: 12px; }
@media (orientation: landscape) { html[data-ui="mobile"] .item-popup-overlay { align-items: center; } }

/* owner 2026-11-11: "windows 1:3 or 2:3, why always long windows stretching sideways?": every window is portrait,
   about 2 wide to 3 tall. Panels take the screen height and about two thirds of it as width (a little wider on very short
   landscape phones so grids still fit); item popups are a narrow card and a comparison stacks the two items. */
#panel-layer .panel:not(.world-atlas-panel), html[data-ui="mobile"] #panel-layer .panel:not(.world-atlas-panel) {
  --win-h: min(720px, calc(100dvh - 24px));
  max-height: var(--win-h) !important; /* the floating-window script writes an inline 560px cap */
  width: min(calc(100vw - 16px), max(340px, calc(var(--win-h) * 0.66)));
}
.item-popup-dialog, .item-popup-dialog.has-comparison, .item-popup-dialog:not(.has-comparison),
html[data-ui="mobile"] .item-popup-dialog:not(.has-comparison) { width: min(340px, calc(100vw - 12px)); }
.item-popup-cards.paired { grid-template-columns: minmax(0, 1fr); }
/* the ✕ and a tap outside already close it, so phones skip the extra "close details" row */
html[data-ui="mobile"] .item-popup-actions [data-a="close"] { display: none; }

/* owner 2026-11-11: the bag window itself is fine, its buttons smaller and tighter */
[data-window-key="panel:inv"] .inv-tabs button { min-height: 32px; padding: 4px 12px; font-size: 13px; }
[data-window-key="panel:inv"] .bag-toolbar { gap: 4px; }
[data-window-key="panel:inv"] .bag-toolbar .btn, [data-window-key="panel:inv"] .bag-toolbar button { min-height: 30px; padding: 3px 9px; font-size: 12px; border-radius: 9px; }
[data-window-key="panel:inv"] .body > p.tip { margin: 2px 0; font-size: 11.5px; }

/* the window that opens when you tap an item: a narrow portrait card (about 2:3), everything stacked */
.item-popup-dialog, .item-popup-dialog.has-comparison, .item-popup-dialog:not(.has-comparison),
html[data-ui="mobile"] .item-popup-dialog:not(.has-comparison) { width: min(300px, calc(100vw - 12px)); }

.mk-sellform { grid-template-columns: 1fr; }
.item-popup-actions .itemcard-actions, html[data-ui="mobile"] .item-popup-actions .itemcard-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.item-popup-actions .btn, html[data-ui="mobile"] .item-popup-actions .btn { min-height: 36px; padding: 3px 8px; font-size: 12px; }
.mk-pop .item-popup-actions { flex-direction: column; gap: 6px; }
.mk-pop .item-popup-actions .btn { flex: none; width: 100%; min-height: 38px; }
/* comparison (gear you are not wearing vs the worn piece): stacked, may use the screen height, tighter cards */
.item-popup-dialog.has-comparison { max-height: min(720px, calc(100dvh - 16px)) !important; }
.item-popup-cards.paired { gap: 6px; }
.item-popup-cards.paired > article { padding: 6px 8px; }
.item-popup-cards.paired .item-popup-label { min-height: 22px; font-size: 12px; }
.item-popup-cards.paired .item-popup-label img { width: 24px; height: 24px; }
.item-popup-cards.paired .itemcard h4 { margin: 1px 0 !important; font-size: 13.5px !important; }
.item-popup-cards.paired .itemcard .stats { font-size: 12px; line-height: 1.4; }
.item-popup-delta h4 { margin: 6px 0 2px !important; font-size: 13px; }
.item-popup-delta .gear-deltas > div { font-size: 12px; }

/* owner 2026-11-11: windows opened by talking to an NPC are 30% smaller and always on the right of the screen
   (PC, landscape and portrait), so the NPC and the player stay visible on the left; they close when you walk away */
#panel-layer > .panel.npc-panel, html[data-ui="mobile"] #panel-layer > .panel.npc-panel:not(.world-atlas-panel) {
  --win-h: min(504px, calc(100dvh - 24px));
  width: min(calc(100vw - 16px), max(300px, calc(var(--win-h) * 0.66))) !important; max-height: var(--win-h) !important;
  font-size: 13px; /* position: set when it opens (Client/js/main.js npcWindowSpot) and still draggable like every window */
}
#panel-layer > .panel.npc-panel > header { padding-top: 6px; padding-bottom: 4px; }
#panel-layer > .panel.npc-panel .li { padding: 6px 8px; gap: 8px; }
#panel-layer > .panel.npc-panel .li img { width: 34px; height: 34px; }
#panel-layer > .panel.npc-panel .btn.small { min-height: 32px; padding: 3px 9px; font-size: 12px; }
html[data-ui="mobile"][data-orient="portrait"] #panel-layer > .panel.npc-panel { width: min(calc(100vw - 16px), 340px) !important; max-height: 44dvh !important; /* below the hero */ }

/* owner 2026-11-11: "hide other players' effects" button during a boss fight (Client/js/fxfilter.js) */
.fx-hide-btn { position: fixed; z-index: 24; left: 50%; top: calc(64px + var(--safe-t, 0px)); transform: translateX(-50%); padding: 6px 12px; border: 2px solid #8a6a4e; border-radius: 999px; background: #fff8ec; color: #4a3222; font: 600 12px KanitArc, sans-serif; box-shadow: 0 3px 10px #3b2a1e33; pointer-events: auto; }
.fx-hide-btn.on { background: #e9fbf6; border-color: #3f9a8f; }
.fx-hide-btn.hidden { display: none; }

/* owner 2026-11-12: food slot in the quick row (old PK place); PK moved next to the first skill slot */
#hud-quick .food-slot { background-size: 34px; }
#hud-quick .food-slot .food-tag { position: absolute; left: 2px; top: 1px; padding: 0 3px; border-radius: 5px; background: #fff3dccc; color: #8a5a2e; font-size: 9px; line-height: 12px; }
#hud-quick .food-slot .food-left { position: absolute; left: 2px; bottom: 1px; padding: 0 2px; border-radius: 5px; background: #e9fbf6dd; color: #2f7f74; font-size: 10px; line-height: 13px; }
#hud-quick .food-slot.active { box-shadow: 0 0 0 2px #7cc9a8, var(--shadow); }
html:not([data-ui="mobile"]) #hud-bar > .pk-btn { flex: none; width: auto; min-width: 52px; height: 44px; padding: 0 8px; border-radius: 10px; }
html[data-ui="mobile"] #hud-bar > .pk-btn { position: absolute; pointer-events: auto; width: calc(50px * var(--k, 1)); min-width: 0; height: calc(34px * var(--k, 1)); min-height: 0; padding: 0; border-radius: 12px; font-size: 11px; right: calc(166px * var(--k, 1) + var(--sr, 0px)); bottom: calc(82px * var(--k, 1) + var(--sb, 0px)); box-shadow: 0 3px 10px rgba(83, 87, 108, .16); }

/* owner 2026-11-12: timed effects with a countdown, bottom centre above the skill slots */
#hud > .buff-row { position: fixed; z-index: 7; left: 50%; bottom: calc(76px + var(--safe-b, 0px)); transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: min(92vw, 420px); pointer-events: auto; }
#hud > .buff-row[hidden] { display: none; }
#hud > .buff-row .buff-box { position: relative; width: 30px; height: 40px; border-radius: 8px; background: #fff8ecee; box-shadow: 0 1px 4px #53576c33; display: flex; flex-direction: column; align-items: center; }
#hud > .buff-row .buff-box img { width: 26px; height: 26px; margin-top: 1px; border-radius: 6px; object-fit: contain; }
#hud > .buff-row .buff-box b { font: 600 9px/12px KanitArc, sans-serif; color: #4a3222; white-space: nowrap; letter-spacing: -.2px; }
#hud > .buff-row .buff-box.low b { color: #c0392b; }
html[data-ui="mobile"] #hud > .buff-row { bottom: calc(6px + var(--safe-b, 0px)); max-width: 46vw; }
html[data-ui="mobile"] #hud > .buff-row .buff-box { width: 28px; height: 38px; }
html[data-ui="mobile"] #hud > .buff-row .buff-box img { width: 24px; height: 24px; }
html[data-ui="mobile"][data-orient="portrait"] #hud > .buff-row { left: calc(10px + var(--safe-l, 0px)); right: auto; bottom: auto; top: calc(84px + env(safe-area-inset-top, 0px)); transform: none; justify-content: flex-start; max-width: 60vw; } /* portrait: under the potion row, clear of the joystick, auto and the skill ring */

/* ===== owner 2026-11-12: NPC windows share one look and get a size that fits what they hold =====
   (they open right of the hero; a wider one grows to the left, Client/js/main.js npcWindowSpot) */
html #panel-layer > .panel.npc-panel:not(.world-atlas-panel)[data-window-key="panel:storage"] { width: min(calc(100vw - 16px), 408px) !important; }
html #panel-layer > .panel.npc-panel:not(.world-atlas-panel)[data-window-key="panel:market"] { --win-h: min(600px, calc(100dvh - 24px)); width: min(calc(100vw - 16px), 460px) !important; }
/* owner 2026-11-12: the smith window stretched sideways (iPad): a tall card, about 1 wide to 2 tall, on every screen */
html #panel-layer > .panel.npc-panel:not(.world-atlas-panel)[data-window-key="panel:smith"] { --win-h: min(760px, calc(100dvh - 24px)); width: min(calc(100vw - 16px), max(340px, calc(var(--win-h) * 0.52))) !important; }
html #panel-layer > .panel.npc-panel:not(.world-atlas-panel)[data-window-key="panel:wardrobe"] { --win-h: min(600px, calc(100dvh - 24px)); width: min(calc(100vw - 16px), 620px) !important; }
html #panel-layer > .panel.npc-panel:not(.world-atlas-panel):is([data-window-key="panel:shop"], [data-window-key="panel:cook"], [data-window-key="panel:teleport"]) { width: min(calc(100vw - 16px), 380px) !important; }
html[data-ui="mobile"][data-orient="portrait"] #panel-layer > .panel.npc-panel:is([data-window-key="panel:storage"], [data-window-key="panel:market"], [data-window-key="panel:wardrobe"]) { width: calc(100vw - 16px) !important; max-height: 56dvh !important; }
html[data-ui="mobile"][data-orient="portrait"] #panel-layer > .panel.npc-panel[data-window-key="panel:smith"] { --win-h: 66dvh; max-height: 66dvh !important; width: min(calc(100vw - 16px), max(340px, 33dvh)) !important; }
/* one header, one tab style, one footer for every NPC */
#panel-layer > .panel.npc-panel > header { background: linear-gradient(#fff8ea, #fbefd8); border-bottom: 1px solid #ecd9b6; }
#panel-layer > .panel.npc-panel .tabs, .npc-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
#panel-layer > .panel.npc-panel .tabs button, #panel-layer > .panel.npc-panel .shop-tabs .btn { flex: 1 1 auto; min-height: 34px; padding: 4px 12px; border: 1px solid #ead8b8; border-radius: 999px; background: #fffaf0; color: #6a5238; font: 600 13px KanitArc, sans-serif; box-shadow: none; }
#panel-layer > .panel.npc-panel .tabs button.on, #panel-layer > .panel.npc-panel .shop-tabs .btn.primary { background: #f2b23a; border-color: #d9951c; color: #3b2a10; }
#panel-layer > .panel.npc-panel .npc-res { margin: 0 0 6px; padding: 6px 10px; border-radius: 10px; background: #fff6e2; font-size: 13px; }
#panel-layer > .panel.npc-panel > .npc-foot { display: flex; gap: 6px; padding: 8px 12px; border-top: 1px solid #ecd9b6; background: #fffaf0; }
#panel-layer > .panel.npc-panel > .npc-foot .btn { flex: 1; min-height: 34px; margin: 0; border-radius: 999px; font-size: 12px; }
/* storage: smaller slots (about 40% smaller) so far more of the stock shows at once */
[data-window-key="panel:storage"] .ex-grid { grid-template-columns: repeat(auto-fill, 38px) !important; gap: 4px; justify-content: start; max-height: min(52vh, 400px); }
[data-window-key="panel:storage"] .ex-grid .cell { width: 38px; border-radius: 8px; background-size: 82%; }
[data-window-key="panel:storage"] .ex-grid .cell .cnt { right: 2px; bottom: 0; font-size: 9px; }
[data-window-key="panel:storage"] .ex-split { gap: 10px; }

/* ===== the character standing in the window with its slots around it (Client/js/paperdoll.js) ===== */
.doll-wrap { position: relative; height: 232px; margin: 0 auto 4px; max-width: 360px; border-radius: 16px; background: radial-gradient(ellipse at 50% 88%, #e9f3e2 0 28%, #fbf3e3 62%); border: 1px solid #ecdcc0; }
.doll-wrap .doll { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); pointer-events: none; }
.doll-slot { position: absolute; display: flex; flex-direction: column; align-items: center; width: 54px; }
.doll-slot .cell, .doll-slot .fashion-slot.mini { width: 46px; height: 46px; padding: 0; border-radius: 12px; background-color: #fffaf0; border: 1px solid #ead8b8; display: grid; place-items: center; }
.doll-slot .fashion-slot.mini .fx-ic { width: 38px; height: 38px; font-size: 18px; }
.doll-slot label { font-size: 10px; color: var(--muted, #7a6a58); white-space: nowrap; margin-top: 1px; }
.doll-gear .ds-weapon, .doll-fashion .ds-hat { left: 8px; top: 10px; } .doll-gear .ds-gloves, .doll-fashion .ds-outfit { left: 8px; top: 82px; } .doll-gear .ds-rod, .doll-fashion .ds-back { left: 8px; top: 154px; }
.doll-gear .ds-armor, .doll-fashion .ds-aura { right: 8px; top: 10px; } .doll-gear .ds-boots, .doll-fashion .ds-tint { right: 8px; top: 82px; } .doll-fashion .ds-pet { right: 8px; top: 154px; }
.doll-eye { position: absolute; right: -2px; top: -6px; width: 22px; height: 22px; padding: 0; border: 1px solid #ead8b8; border-radius: 50%; background: #fff; font-size: 12px; line-height: 1; box-shadow: 0 1px 3px #0002; }
.doll-eye.off { background: #f1e4e4; }
.doll-rot { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); display: flex; gap: 6px; }
.doll-rot button { width: 30px; height: 26px; padding: 0; border: 1px solid #ead8b8; border-radius: 999px; background: #fffaf0; font-size: 14px; }
.doll-foot { text-align: center; min-height: 18px; margin-bottom: 6px; }
.doll-tabs { justify-content: center; }
/* wardrobe: doll left, the shop list right (stacked on narrow screens) */
.ward-split { display: grid; grid-template-columns: minmax(0, 250px) minmax(0, 1fr); gap: 12px; align-items: start; }
.ward-split .ward-doll { position: sticky; top: 0; }
.ward-split .doll-wrap { max-width: 250px; }
.ward-row { cursor: pointer; gap: 8px; } .ward-row .fx-ic { width: 38px; height: 38px; flex: none; font-size: 18px; }
.ward-row.trying { border-color: #3fbfaa; box-shadow: 0 0 0 2px #3fbfaa55; background: #effaf6; }
@media (max-width: 560px) { .ward-split { grid-template-columns: 1fr; } .ward-split .ward-doll { position: static; } .ward-split .doll-wrap { max-width: 320px; } }
.fx-ic.pv { background-color: #fffaf0; background-size: contain; background-repeat: no-repeat; }
.doll-slot .fashion-slot.mini.hid { opacity: .45; filter: grayscale(.6); }

/* ===== owner 2026-11-12: bag windows show the character beside the bag; NPC shops always show your bag ===== */
html #panel-layer > .panel:not(.world-atlas-panel)[data-window-key="panel:inv"], html #panel-layer > .panel:not(.world-atlas-panel)[data-window-key="panel:shop"] { width: min(calc(100vw - 16px), 780px) !important; container-type: inline-size; }
html #panel-layer > .panel.npc-panel:not(.world-atlas-panel)[data-window-key="panel:shop"] { width: min(calc(100vw - 16px), 780px) !important; container-type: inline-size; }
html #panel-layer > .panel.npc-panel:not(.world-atlas-panel)[data-window-key="panel:wardrobe"], html #panel-layer > .panel:not(.world-atlas-panel)[data-window-key="panel:wardrobe"] { width: min(calc(100vw - 16px), 1000px) !important; container-type: inline-size; }
.inv-split { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 14px; align-items: start; }
.inv-split > section { min-width: 0; }
.inv-split .inv-doll, .ward-split .ward-doll { position: sticky; top: 0; }
.inv-split .doll-wrap { max-width: 280px; }
.inv-split .inv-bag .inv-worn { display: none; } /* the doll shows what is worn */
.shop-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.shop-split .shop-goods .list { max-height: none; }
.ward-split { grid-template-columns: minmax(0, 250px) minmax(0, 1fr) minmax(0, 300px) !important; }
@container (max-width: 760px) { .ward-split { grid-template-columns: minmax(0, 250px) minmax(0, 1fr) !important; } .ward-split .ward-bag { grid-column: 1 / -1; } }
@container (max-width: 560px) { .inv-split, .shop-split, .ward-split { grid-template-columns: 1fr !important; } .inv-split .inv-doll, .ward-split .ward-doll { position: static; } .inv-split .doll-wrap { max-width: 320px; } }
html[data-ui="mobile"][data-orient="portrait"] #panel-layer > .panel.npc-panel[data-window-key="panel:shop"] { width: calc(100vw - 16px) !important; max-height: 56dvh !important; }
.ward-bag #fashion-shop, .shop-bag #bag-bar { display: none; } /* already in the wardrobe / shop */

/* owner 2026-11-12 (2nd pass): fashion space as square slots like the bag; wardrobe = [character + your bag | shop] */
.fashion-cells { grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); max-height: 46vh; overflow: auto; }
.fash-cell { display: grid; place-items: center; background-color: var(--chip, #f3ecdc); }
.fash-cell .fx-ic { width: 82%; height: 82%; box-shadow: none; font-size: 18px; }
.fash-cell.worn { border-color: #d8b25a; box-shadow: inset 0 0 0 2px #f2d27a; }
.fash-cell .fash-worn, .fash-cell .fashion-try { position: absolute; right: 1px; top: 1px; padding: 0 4px; border-radius: 6px; font: 600 9px/13px KanitArc, sans-serif; font-style: normal; color: #fff; background: #d39a2a; }
.fash-cell .fashion-try { background: #5aa9e6; }
.inv-bag .fashion-worn, .ward-bag .fashion-worn { display: none; } /* the character shows what is worn */
html #panel-layer > .panel.npc-panel:not(.world-atlas-panel)[data-window-key="panel:wardrobe"], html #panel-layer > .panel:not(.world-atlas-panel)[data-window-key="panel:wardrobe"] { width: min(calc(100vw - 16px), 880px) !important; }
.ward-split { grid-template-columns: minmax(0, 340px) minmax(0, 1fr) !important; }
.ward-split .ward-doll { position: static; }
.ward-split .ward-doll .doll-wrap { max-width: 340px; }
.ward-split .ward-bag { margin-top: 6px; border-top: 1px solid #ecd9b6; padding-top: 6px; }
@container (max-width: 760px) { .ward-split .ward-bag { grid-column: auto; } }
@container (max-width: 600px) { .ward-split { grid-template-columns: 1fr !important; } }
/* market (owner 2026-11-12): 20% wider, smaller tidier controls in neat rows */
html #panel-layer > .panel.npc-panel:not(.world-atlas-panel)[data-window-key="panel:market"] { width: min(calc(100vw - 16px), 552px) !important; }
[data-window-key="panel:market"] .tabs { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px !important; margin: 2px 0 6px !important; }
[data-window-key="panel:market"] .tabs button { min-height: 28px !important; padding: 2px 6px !important; font-size: 12px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-window-key="panel:market"] .mk-filter { margin: 4px 0 6px; gap: 6px; }
[data-window-key="panel:market"] .mk-filter input, [data-window-key="panel:market"] .mk-filter select { min-height: 30px; padding: 3px 8px; font-size: 13px; }
[data-window-key="panel:market"] .mk-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 4px; margin-bottom: 6px; }
[data-window-key="panel:market"] .mk-cats button { padding: 3px 8px; font-size: 12px; min-height: 28px; text-align: left; display: flex; align-items: center; justify-content: space-between; }
[data-window-key="panel:market"] .npc-res, [data-window-key="panel:market"] .body > p:first-child { font-size: 12px; margin: 0 0 4px; }
[data-window-key="panel:market"] .mk-row { padding: 5px 8px; gap: 8px; }
[data-window-key="panel:market"] .mk-row img { width: 34px; height: 34px; }
/* owner 2026-11-12: the hide-effects button is a small icon on the right edge, out of the way of loot (also in Settings) */
.fx-hide-btn { left: auto !important; right: calc(8px + var(--safe-r, 0px)); top: 52% !important; transform: none !important; width: 34px; height: 34px; padding: 0 !important; border-radius: 50% !important; font-size: 15px !important; line-height: 1; display: grid; place-items: center; opacity: .85; }
.fx-hide-btn.hidden { display: none !important; }
html[data-ui="mobile"] .fx-hide-btn { top: 38% !important; }
/* owner 2026-11-12: the creator (admin) window: wider, topic cards in two columns, smaller buttons, less empty space */
html #panel-layer > .panel:not(.world-atlas-panel)[data-window-key="panel:dev"] { width: min(calc(100vw - 16px), 900px) !important; --win-h: min(760px, calc(100dvh - 24px)); }
[data-window-key="panel:dev"] .dev-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 8px; align-items: start; }
[data-window-key="panel:dev"] .dev-card { border: 1px solid #ecd9b6; border-radius: 12px; background: #fffaf0; padding: 6px 10px 8px; min-width: 0; }
[data-window-key="panel:dev"] .dev-card > h4 { margin: 0 0 6px; font-size: 13px; color: #6a5238; }
[data-window-key="panel:dev"] .dev-card .btn.small { min-height: 28px; padding: 2px 9px; font-size: 12px; margin: 0; }
[data-window-key="panel:dev"] .dev-card .row, [data-window-key="panel:dev"] .dev-card .gap { gap: 4px !important; }
[data-window-key="panel:dev"] .dev-card p.tip { margin: 4px 0; font-size: 11.5px; }
[data-window-key="panel:dev"] .dev-card select, [data-window-key="panel:dev"] .dev-card input:not([type=checkbox]) { min-height: 28px; padding: 2px 6px; font-size: 12px; }
[data-window-key="panel:dev"] .dev-card table { font-size: 12px; }
/* owner 2026-11-12: worn gear at 0 durability - a red, glowing warning icon at the front of the buff row */
#hud > .buff-row .buff-box.dur-warn { background: #fff0ee; box-shadow: 0 0 0 2px #e0453a; cursor: pointer; position: relative; }
/* the glow pulses by opacity only (GPU), not by repainting a box-shadow every frame (2026-11-12, lag on phones) */
#hud > .buff-row .buff-box.dur-warn::after { content: ""; position: absolute; inset: -2px; border-radius: inherit; box-shadow: 0 0 14px 5px #ff5a4aee; pointer-events: none; will-change: opacity; animation: durGlow 1.1s ease-in-out infinite alternate; }
#hud > .buff-row .buff-box.dur-warn img { filter: saturate(.6) brightness(.95); }
#hud > .buff-row .buff-box.dur-warn b { color: #c0392b; font-size: 8.5px; }
#hud > .buff-row .buff-box .dur-x { position: absolute; right: -5px; top: -6px; width: 15px; height: 15px; border-radius: 50%; background: #e0453a; color: #fff; font: 700 10px/15px KanitArc, sans-serif; font-style: normal; text-align: center; box-shadow: 0 1px 3px #0005; }
@keyframes durGlow { from { opacity: .35; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #hud > .buff-row .buff-box.dur-warn::after { animation: none; } }
/* owner 2026-11-12: how many to sell / drop from a stack */
.qty-ask { position: fixed; inset: 0; z-index: 9000; background: #2a1d1466; display: flex; align-items: center; justify-content: center; }
.qty-ask .qty-card { width: min(320px, calc(100vw - 32px)); background: #fff8ec; border: 2px solid #e9cfa6; border-radius: 16px; padding: 14px 16px; box-shadow: 0 8px 28px #3b2a1e55; color: #5a4030; }
.qty-ask h4 { margin: 0 0 4px; font-size: 16px; }
.qty-ask .qty-row { display: flex; gap: 8px; align-items: center; margin: 10px 0 6px; }
.qty-ask .qty-row input { flex: 1; min-width: 0; text-align: center; font-size: 18px; padding: 6px; border-radius: 10px; border: 1.5px solid #e0c79e; background: #fff; }
.qty-ask .qty-row button { width: 40px; height: 40px; border-radius: 10px; font-size: 20px; }
.qty-ask input[type=range] { width: 100%; }
.qty-ask .qty-quick { display: flex; gap: 6px; margin-top: 6px; }
.qty-ask .qty-quick button { flex: 1; padding: 6px 0; border-radius: 9px; }
.qty-ask .qty-sum { margin: 10px 0 8px; font-weight: 600; text-align: center; }
.qty-ask .qty-act { display: flex; gap: 8px; }
.qty-ask .qty-act button { flex: 1; padding: 9px 0; border-radius: 11px; font-weight: 600; }
.qty-ask .qty-ok { background: #3fae9a; color: #fff; border: 0; }
.qty-ask .qty-ok.warn { background: #e0614d; }
.qty-ask input[type=range] { accent-color: #3fae9a; }
/* owner 2026-11-12: total stats under the doll in the bag */
.inv-doll .inv-stats { margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: #fffaf2; border: 1.5px solid #eadcc4; }
.inv-doll .inv-stats h4 { margin: 0 0 6px; font-size: 14px; }
.inv-doll .inv-st-base { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 6px; font-size: 12px; color: #6b5a48; }
.inv-doll .inv-st-base b { color: #3b2a1e; }
.inv-doll .inv-stats .kv { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 3px 8px; font-size: 12.5px; align-items: baseline; }
.inv-doll .inv-stats .kv span { color: #6b5a48; }
.inv-doll .inv-stats .kv b { text-align: right; padding-right: 6px; }
/* owner 2026-11-14 (CBT): the shop list scrolls on its own so the try-on preview on the left stays in view; compact buttons */
.ward-split .ward-list { max-height: min(70vh, 640px); overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
.ward-split .ward-list .list { max-height: none; }
.ward-btns { display: flex; gap: 4px; align-items: center; flex: none; }
.ward-btns .btn.on { background: #3fbfaa; color: #fff; border-color: #3fbfaa; }
.cbt-lock { background: #f3e3c3 !important; color: #8a6a3a !important; font-size: 11px; white-space: nowrap; }
.doll-wrap { position: relative; }
.doll-pet { position: absolute; right: 12%; bottom: 14%; width: 28%; max-width: 86px; pointer-events: none; filter: drop-shadow(0 2px 2px #0003); z-index: 1; }
.fd-btns { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.fashion-detail .fd-btns .btn { width: auto; min-height: 28px; padding: 3px 14px; font-size: 13px; }
@container (max-width: 600px) {
  .ward-split .ward-list { max-height: 40dvh; }
  .ward-split .ward-doll .doll-wrap { max-width: 230px; margin: 0 auto; }
  .ward-split .ward-bag { display: none; }
}
.itemcard .cos-pic { display: block; width: 72px; height: 72px; object-fit: contain; margin: 2px auto 4px; }
.fashion-cells > p.tip { grid-column: 1 / -1; }
/* owner 2026-11-14: character-bound gifts are clearly marked */
.cell.item-bound { box-shadow: inset 0 0 0 2px #c79bd8; }
.cell.item-bound::after { content: '🎗'; position: absolute; left: 1px; bottom: 0; font-size: 11px; line-height: 1; filter: drop-shadow(0 0 1px #fff); }
.bound-note { grid-column: 1 / -1; flex-basis: 100%; width: 100%; box-sizing: border-box; margin: 4px 0; padding: 4px 8px; border-radius: 8px; background: #f6ecfb; color: #6a3d82; font-size: 12px; }
.mail-tabs { margin-bottom: 6px; } .mail-acct-tip { background: #fff6dc; border-radius: 8px; padding: 6px 8px; } .mail-by { display: block; color: #8a6a4a; }
.bar-remove { color: #b4525a; border-color: #e7c2c2; }
/* owner 2026-11-15: crystal shop - tabs stay on top of the right list, another class's outfit is red like an unusable weapon */
.ward-split .ward-list .ward-tabs { position: sticky; top: 0; z-index: 2; background: #fffaf0; padding: 2px 0 6px; flex-wrap: wrap; gap: 4px; }
.ward-split .ward-list .ward-tabs button small { opacity: .65; font-size: 10px; }
.ward-row.ward-wrong { position: relative; background: #f8dcdc; border-color: #d99a9f; }
.ward-row.ward-wrong::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: rgba(155, 40, 52, .14); pointer-events: none; }
.ward-row .ward-who { display: block; color: #2c7a6f; }
.ward-row.ward-wrong .ward-who { color: #a33b47; font-weight: 600; }
/* owner 2026-11-15: auto-potion as small tap buttons */
.pot-rows { display: flex; flex-direction: column; gap: 5px; }
.pot-row { display: flex; align-items: center; gap: 6px; }
.pot-row > b { width: 26px; flex: none; font-size: 12px; }
.pot-row .pot-hp { color: #c74b55; } .pot-row .pot-mp { color: #3b78b8; }
.pot-pick { display: flex; flex-wrap: wrap; gap: 3px; }
.pot-pick button { min-width: 34px; height: 26px; padding: 0 5px; border: 1px solid #d9c9a8; border-radius: 7px; background: #fffaf0; color: #5a4a36; font: inherit; font-size: 11px; cursor: pointer; }
.pot-pick button.on { background: #3fbfaa; border-color: #2f9e8c; color: #fff; font-weight: 600; }
/* owner 2026-11-15: windows are portrait (about 2:3), so the shop list sat in a ~100 px column. The preview now sits on
   top (smaller) and the shop list below it with its own tabs and its own scroll */
#panel-layer .ward-split { grid-template-columns: minmax(0, 1fr) !important; gap: 8px; }
#panel-layer .ward-split .ward-doll { position: static; display: grid; grid-template-columns: minmax(0, 1fr); }
#panel-layer .ward-split .ward-doll .doll-wrap { max-width: 340px; width: 100%; margin: 0 auto; }
#panel-layer .ward-split .ward-bag { display: none; }
#panel-layer .ward-split .ward-list { max-height: min(52dvh, 460px); }
/* owner 2026-11-15: the crystal shop sells more than the fashion shop, so it opens in a wide window: preview on the left,
   one list split by tabs on the right (own scroll); on a narrow screen it stacks like the fashion shop */
#panel-layer > .panel.crystal-panel { width: min(920px, calc(100vw - 16px)) !important; }
@media (min-width: 700px) {
  #panel-layer .crystal-panel .ward-split.crystal-split { grid-template-columns: minmax(0, 320px) minmax(0, 1fr) !important; align-items: start; }
  #panel-layer .crystal-panel .ward-split.crystal-split .ward-doll { position: sticky; top: 0; }
  #panel-layer .crystal-panel .ward-split.crystal-split .ward-list { max-height: min(calc(var(--win-h, 720px) - 150px), 600px); }
}
#panel-layer .crystal-panel .crystal-item img { width: 38px; height: 38px; object-fit: contain; flex: none; }
#panel-layer .ward-row .ward-btns .btn, #panel-layer .ward-row .ward-btns .pill { white-space: nowrap; }
#panel-layer .ward-row.crystal-item { flex-wrap: nowrap; }
@media (max-width: 560px) {
  #panel-layer .ward-row, #panel-layer .ward-row.crystal-item { flex-wrap: wrap; }
  #panel-layer .ward-row .grow { flex: 1 1 calc(100% - 60px); min-width: 0; }
  #panel-layer .ward-row .ward-btns { flex: 1 1 100%; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; } /* owner 2026-11-16: 3 EXP-scroll buttons wrap instead of running off the left edge */
}
/* owner 2026-11-15: report a problem */
.fb-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.fb-text { width: 100%; box-sizing: border-box; min-height: 130px; resize: vertical; padding: 10px; border: 1px solid #d9c9a8; border-radius: 10px; background: #fffdf6; font: inherit; font-size: 14px; color: #3f3527; }
.fb-row { justify-content: space-between; align-items: center; margin-top: 6px; }
.fb-note { white-space: pre-wrap; }
/* owner 2026-11-15: the blacksmith opens wide like the sweets shop: bag (sell) on the left, the smith on the right */
html #panel-layer > .panel:not(.world-atlas-panel)[data-window-key="panel:smith"], html #panel-layer > .panel.npc-panel:not(.world-atlas-panel)[data-window-key="panel:smith"] { width: min(calc(100vw - 16px), 820px) !important; container-type: inline-size; }
html[data-ui="mobile"][data-orient="portrait"] #panel-layer > .panel[data-window-key="panel:smith"] { width: calc(100vw - 16px) !important; }
@container (max-width: 560px) { .smith-split { grid-template-columns: 1fr !important; } .smith-split .smith-goods { order: -1; } }
.smith-cls { margin: 4px 0 8px; } .smith-cls .btn { flex: 0 0 auto; }
.smith-goods .npc-tabs button { flex: 1 1 0; min-width: 0; }
/* owner 2026-11-15: gear rarity pickup filter (Settings) */
.loot-min-row { margin-top: 6px; } .loot-min-row .loot-min-label { width: auto; font-size: 12px; white-space: nowrap; }
.loot-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; border: 1px solid #0002; vertical-align: -1px; }
/* owner 2026-11-15: the pet in Settings - a square face icon and its own name */
.pet-set { display: flex; align-items: center; gap: 10px; margin: 2px 0 4px; }
.pet-set .pet-face { flex: none; width: 48px; height: 48px; aspect-ratio: 1 / 1; border-radius: 10px; border: 1px solid #e3cfa8; background: #fff8e6; display: grid; place-items: center; overflow: hidden; }
.pet-set .pet-face .fx-ic { width: 44px; height: 44px; background-size: contain; background-position: center; background-repeat: no-repeat; }
.pet-set .pet-none { font-size: 22px; opacity: .6; }
/* owner 2026-11-15: live skill numbers stand out in the skills window */
.sk-num { color: #b5651d; font-weight: 700; }
