/* Mini App: окно обмена: лавка, сундук, тело, карманы, услуги, мастерская. */
/* ---------- окно обмена (лавка, сундук, тело, карманы): чужое сверху, своё снизу, подсказка вещи поверх своей сумки ---------- */
#v-box { inset: 0; z-index: 35; background: var(--night-2); }
.xic { width: 40px; height: 40px; flex: none; border-radius: var(--r-sm); border: 1px solid var(--ochre); background: var(--night-2); display: grid; place-items: center; color: var(--candle); overflow: hidden; }
.xic img { width: 34px; height: 34px; object-fit: contain; } .xic .i { width: 24px; height: 24px; }
#xTtl:focus { outline: none; }
.xplates { flex: none; display: flex; flex-direction: column; gap: 6px; padding: 8px 14px 0; } .xplates:empty { display: none; }
.xplate { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--card); font-size: 13px; }
.xplate.warn { border-color: var(--wine-2); background: #7a2e2e2a; color: var(--danger-soft); }
.xplate.adv { border-color: var(--ochre); color: var(--candle); }
.xplate button { margin-left: auto; min-height: 44px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--night-2); color: var(--parch); font-weight: 700; }
.xthem { flex: 0 1 auto; max-height: 45%; overflow-y: auto; overscroll-behavior: contain; padding: 10px 14px; }
.xgrid { grid-template-columns: repeat(4, minmax(0, 80px)); justify-content: center; }
.xgrid .inv-cell .q { top: 2px; bottom: auto; }
.inv-cell .xp, .inv-cell .xr { position: absolute; left: 0; right: 0; bottom: 0; padding: 1px 2px; font: 700 12px/1.25 "PT Sans", sans-serif; color: var(--parch); background: rgb(5 7 13 / .74);
  text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-cell .xp.sale { color: var(--candle); } .inv-cell .xp s { color: var(--parch-dim); font-weight: 400; margin-right: 3px; }
.xcap.xr.rk-low { color: var(--parch-dim); } .xcap.xr.rk-medium { color: var(--candle); } .xcap.xr.rk-high { color: var(--danger-soft); font-weight: 700; }
.xcoin { --r: var(--ochre); } .xcoin .em .i { width: 34px; height: 34px; color: var(--candle); }
.inv-cell.off { opacity: .45; }
.inv-cell.fly { transition: transform .18s ease-in, opacity .18s ease-in; z-index: 5; pointer-events: none; }
.xchips { display: flex; gap: 6px; overflow-x: auto; margin: 0 -14px 8px; padding: 0 14px; scrollbar-width: none; }
.xchips button { flex: none; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; color: var(--parch-dim); background: var(--card); }
.xchips button[aria-pressed="true"] { border-color: var(--candle); color: var(--candle); background: #ffcf6b14; font-weight: 700; }
.xstrip { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-height: 52px; padding: 4px 14px; background: var(--night-3); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.xstrip .xg { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--parch-dim); font-variant-numeric: tabular-nums; white-space: nowrap; } .xstrip .xg b { color: var(--candle); }
.xacts { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; }
.xbtn { min-height: 44px; padding: 2px 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--card); color: var(--parch); font-weight: 700; font-size: 13px;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; }
.xbtn.main { background: var(--ochre); color: var(--ink); border: 2px solid var(--ink); box-shadow: 0 2px 0 var(--ink); }
.xbtn small { font-weight: 400; font-size: 12px; } .xbtn:disabled { opacity: .5; box-shadow: none; }
.xchip { display: inline-flex; align-items: center; min-height: 28px; font-size: 12px; font-weight: 700; padding: 0 10px; border-radius: 999px; border: 1px solid var(--ochre); color: var(--candle); font-variant-numeric: tabular-nums; white-space: nowrap; }
.xchip.bad { border-color: var(--wine-2); color: var(--danger-soft); }
.xmw { position: relative; flex: 1; min-height: 0; display: flex; }
.xmine { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px 14px calc(16px + var(--safe-b)); }
.xlbl { font-size: 12px; color: var(--ochre); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin: 2px 0 8px; }
.xtip.inv-tip { position: absolute; left: 8px; right: 8px; bottom: calc(8px + var(--safe-b)); max-height: calc(100% - 16px); z-index: 2; }
.xtip .nm { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.xtip .acts button.risk { background: var(--wine); color: var(--white-ish); }
.xtip .acts button small { display: block; font-weight: 400; font-size: 12px; }
.xstep { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.xstep button { min-width: 44px; min-height: 44px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--night-2); font-weight: 700; font-size: 17px; }
.xstep button:disabled { opacity: .4; }
.xstep output { min-width: 40px; text-align: center; font: 700 20px "Cormorant SC", serif; color: var(--candle); font-variant-numeric: tabular-nums; }
.xstep .all { margin-left: auto; font-size: 13px; padding: 0 14px; }
.xlock { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 12px; border: 1px dashed var(--ochre); border-radius: var(--r-lg); background: var(--card); text-align: center; }
.xlock > .i { width: 32px; height: 32px; color: var(--candle); } .xlock b { font: 700 20px "Cormorant SC", serif; color: var(--candle); }
.xlock .xbtns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; width: 100%; } .xlock .xbtn { flex: 1 1 140px; } .xlock .xbtn.wide { flex-basis: 100%; }
.xskel { display: grid; grid-template-columns: repeat(4, minmax(0, 80px)); justify-content: center; gap: 6px; } .xskel i { height: auto; aspect-ratio: 1; }
.inv-cell .xst { position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--wine); color: var(--white-ish); display: grid; place-items: center; }
.inv-cell .w ~ .xst { top: 20px; } .inv-cell .xst .i { width: 11px; height: 11px; }
.xmine .xgrid + .xlbl { margin-top: 16px; }   /* «Ваш обоз», потом «Ваша сумка» */
.xcw { display: flex; flex-direction: column; gap: 3px; min-width: 0; } .xcap { font-size: 11px; line-height: 1.2; color: var(--parch-dim); text-align: center; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.inv-cell .xp.poor { color: var(--danger-soft); }
.xsvc .hd .whyl { font-size: 12px; color: var(--danger-soft); }
.xtrapb { display: flex; gap: 6px; } .xtrapb .xbtn { flex: 1 1 0; }
.bh-seg button { min-height: 44px; font-size: 15px; }
.xsvc { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); margin-bottom: 6px; }
.xsvc[aria-expanded="true"] { border-color: var(--candle); }
.xsvc > .hd { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 6px 12px; text-align: left; }
.xsvc .hd .gi, .xsvc .hd > .i { width: 32px; height: 32px; flex: none; color: var(--candle); }
.xsvc .hd .nm { font-weight: 700; } .xsvc .hd .tx { font-size: 12px; color: var(--parch-dim); }
.xsvc .hd .pr { margin-left: auto; font-weight: 700; color: var(--candle); font-variant-numeric: tabular-nums; white-space: nowrap; } .xsvc .hd .pr s { color: var(--parch-dim); font-weight: 400; margin-right: 3px; }
.xsvc .bd { display: flex; flex-direction: column; gap: 8px; padding: 0 12px 12px; }
.xsvc .bd .xchips { margin: 0; padding: 0; flex-wrap: wrap; } .xsvc .bd .xbtn { width: 100%; }
.xsvc .why { font-size: 12px; color: var(--danger-soft); }
.xseg { margin-bottom: 10px; }
.xsvc .bd .xbtn.risk { background: var(--wine); color: var(--white-ish); border-color: var(--wine-2); }
.xfull .xthem { max-height: none; flex: 1; } .xfull .xmw { display: none; }
/* без своей сумки (услуги, игры, тело, касса, агент и порт): чужое на всю высоту, подсказка вещи всплывает снизу поверх */
.nobag .xthem { max-height: none; flex: 1; } .nobag .xmw { flex: none; height: 0; } .nobag .xmine { display: none; } .nobag .xtip.inv-tip { max-height: 70dvh; } .nobag .xstrip { padding-bottom: calc(4px + var(--safe-b)); border-bottom: 0; }
.xstrip:empty { display: none; }
.xdanger { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0 2px; border-top: 1px dashed var(--line); }   /* продать дом, дело, корабль — отдельным рядом, не рядом с «Взять всё» */
.xbtn.danger { background: transparent; border-color: var(--wine-2); color: var(--danger-soft); }
.xopt { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; padding: 0 14px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); font-weight: 700; }
.xopt[aria-checked="true"] { border-color: var(--candle); color: var(--candle); background: #ffcf6b14; } .xopt b { color: var(--candle); font-variant-numeric: tabular-nums; }
.xwide { width: 100%; margin: 10px 0 4px; } .xthem > .why { font-size: 12px; color: var(--danger-soft); margin-bottom: 10px; }
.xlist { margin: 0 0 12px; padding-left: 18px; font-size: 13px; color: var(--parch-dim); font-variant-numeric: tabular-nums; }
.xq { display: flex; flex-direction: column; gap: 6px; padding: 12px; margin-bottom: 8px; border: 1px solid var(--line); border-left: 3px solid var(--ochre); border-radius: var(--r-md); background: var(--card); }
.xq h3 { margin: 0; font: 700 18px "Cormorant SC", serif; color: var(--parch); } .xq p { margin: 0; font-size: 14px; }
.xqm { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; } .xqm .from { font-size: 12px; color: var(--parch-dim); } .xchip .i, .xchip .gi { width: 16px; height: 16px; margin-right: 4px; }
.xq .tk { font-size: 13px; color: var(--candle); }
.bh-n { text-align: right; font-size: 12px; color: var(--parch-dim); margin-top: 4px; font-variant-numeric: tabular-nums; }
/* мастерская (bridge/craft.ts): карточки рецептов, ингредиенты чипами, наборы, место сбора трав */
.xrc .top { display: flex; align-items: center; gap: 10px; } .xrc .top > img, .xrc .top > .em, .xrc .top > .i { width: 40px; height: 40px; flex: none; object-fit: contain; color: var(--candle); }
.xrc .nm { font: 700 18px "Cormorant SC", serif; color: var(--parch); } .xrc .kd { font-size: 12px; color: var(--parch-dim); }
.xrc .rk { margin-left: auto; font-size: 12px; color: var(--parch-dim); white-space: nowrap; } .xrc .xbtn { width: 100%; } .xrc .why { font-size: 12px; color: var(--danger-soft); }
.xing { display: flex; flex-wrap: wrap; gap: 6px; }
.xing span { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 0 8px 0 4px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; font-variant-numeric: tabular-nums; }
.xing span > img, .xing span > .em { width: 20px; height: 20px; object-fit: contain; } .xing .miss { opacity: .5; border-style: dashed; }
.xtools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; } .xtools .gi { width: 18px; height: 18px; margin-right: 4px; }
.xhint { font-size: 12px; color: var(--parch-dim); margin: 0 0 10px; } .xlnk { all: unset; cursor: pointer; color: var(--candle); text-decoration: underline; text-underline-offset: 2px; } .xmore { text-align: center; font-size: 13px; color: var(--parch-dim); margin: 6px 0 12px; }
.inv-tip .acts button small { display: block; font-weight: 400; font-size: 12px; }
.inv-ws { display: flex; gap: 8px; margin: 10px 0 0; }
.inv-ws .xbtn { flex: 1 1 0; min-width: 0; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; justify-items: start; text-align: left; padding: 6px 10px; }
.inv-ws .xbtn .i { width: 18px; height: 18px; grid-row: span 2; align-self: center; } .inv-ws .xbtn small { grid-column: 2; font-weight: 400; color: var(--parch-dim); }

