/* ВіртСіті (VirtCity) — Єдина дизайн-система Frosted Glass OS
   Адаптована для телефону (360–430×844, Bottom Sheets, 5-кнопковий док) та ПК (1366×768+, плаваючі острови) */
@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: dark;
  --bg: #0b1120;
  --glass-hud: linear-gradient(155deg, rgba(13, 21, 38, 0.88) 0%, rgba(8, 14, 27, 0.92) 100%);
  --glass-modal: linear-gradient(162deg, rgba(14, 22, 40, 0.90) 0%, rgba(8, 14, 26, 0.95) 100%);
  --glass-card: rgba(255, 255, 255, 0.06);
  --glass-card-hov: rgba(255, 255, 255, 0.10);
  --glass-pill: rgba(255, 255, 255, 0.085);
  --line: rgba(255, 255, 255, 0.16);
  --line-hi: rgba(255, 255, 255, 0.28);
  --spec-rim: inset 0 1px 0 rgba(255, 255, 255, 0.26), inset 0 -1px 0 rgba(255, 255, 255, 0.05);
  --shadow-float: 0 14px 34px rgba(4, 9, 22, 0.44);
  --txt: #f8fafc;
  --muted: #cbd5e1;
  --subtle: #94a3b8;
  --accent: #38bdf8;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #fb7185;
  --purple: #a855f7;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; }
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--txt);
  font-family: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;
  touch-action: none;
  -webkit-font-smoothing: antialiased;
}

#cv { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hidden { display: none !important; }

/* ---------- Шар HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud button, #hud input, .interactive { pointer-events: auto; }

/* ---------- Верхній Лівий Острів (#hudTop: Портрет + Статус + Потреби) ---------- */
#hudTop {
  position: absolute;
  top: calc(8px + env(safe-area-inset-top, 0px));
  left: calc(8px + env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 6px;
  max-width: calc(100vw - 122px);
  pointer-events: auto;
}

.hud-card {
  background: var(--glass-hud);
  border: 1px solid var(--line-hi);
  border-radius: 20px;
  padding: 7px 9px;
  box-shadow: var(--spec-rim), var(--shadow-float);
  contain: layout style;
  transform: translateZ(0);
  transition: border-color 0.28s ease, box-shadow 0.28s ease, background 0.28s ease;
}

body.in-ghetto .hud-card,
body.in-ghetto #miniWrap,
body.in-ghetto .util-btn,
body.in-ghetto #dock {
  background: linear-gradient(155deg, rgba(34, 14, 26, 0.88) 0%, rgba(14, 10, 22, 0.92) 100%);
  border-color: rgba(251, 113, 133, 0.38);
  box-shadow: inset 0 1px 0 rgba(253, 164, 175, 0.26), 0 14px 34px rgba(16, 4, 10, 0.50);
}

.hud-body {
  display: flex; align-items: center; gap: 8px;
}

/* Живий портрет героя (відкриває Профіль) */
.hero-btn {
  position: relative;
  flex: none;
  width: 44px; height: 44px; padding: 0;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 35%, rgba(56, 189, 248, 0.22), rgba(15, 23, 42, 0.68));
  border: 1.5px solid rgba(125, 211, 252, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 4px 12px rgba(0, 0, 0, 0.32);
  cursor: pointer;
  overflow: visible;
  transition: transform 0.16s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.hero-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(186, 230, 253, 0.85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 6px 16px rgba(56, 189, 248, 0.28);
}
.hero-btn:active { transform: scale(0.95); }
.hero-btn.happy {
  border-color: rgba(110, 231, 183, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 14px rgba(52, 211, 153, 0.26);
}
.hero-btn.tired {
  border-color: rgba(253, 164, 175, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 14px rgba(251, 113, 133, 0.28);
}
#heroAvatarCv {
  width: 100%; height: 100%;
  display: block;
  border-radius: 12.5px;
  pointer-events: none;
}
.hero-mood-badge {
  position: absolute;
  right: -4px; bottom: -4px;
  padding: 1.5px 4.5px;
  border-radius: 999px;
  font-size: 9px; font-weight: 800; line-height: 1.1;
  background: rgba(16, 185, 129, 0.92);
  color: #022c22;
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}
.hero-mood-badge.tired {
  background: rgba(244, 63, 94, 0.92);
  color: #fff1f2;
}

.hud-main { flex: 1; min-width: 0; }

.zone-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.zone-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700;
  flex: 1 1 auto; min-width: 0; max-width: 100%; letter-spacing: -0.01em;
}
#zoneName {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.zone-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); flex: none; }
.zone-pill.lawless .zone-dot { background: var(--red); box-shadow: 0 0 10px var(--red); }
.zone-pill.lawless { color: #fecdd3; }
#clockTxt {
  font-size: 11px; color: #e2e8f0; font-weight: 600; white-space: nowrap;
  font-variant-numeric: tabular-nums; flex: none;
  padding: 2px 6px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.money-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 5px;
}
.m-chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 3.5px;
  padding: 2.5px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  background: var(--glass-pill);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  cursor: pointer; font-variant-numeric: tabular-nums;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.m-chip:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.26); }
.m-chip.card { color: #bae6fd; }
.m-chip.cash { color: #bbf7d0; }
.m-chip.hp { color: #fecdd3; }
.m-chip.mood { color: #e2e8f0; font-size: 11px; font-weight: 600; }
.m-chip.mood.happy { color: #a7f3d0; border-color: rgba(52, 211, 153, 0.5); background: rgba(16, 185, 129, 0.20); }
.m-chip.mood.tired { color: #fecdd3; border-color: rgba(251, 113, 133, 0.5); background: rgba(244, 63, 94, 0.22); }
.m-chip.wanted { background: rgba(244, 63, 94, 0.28); border-color: rgba(251, 113, 133, 0.65); color: #ffe4e6; animation: pulseW 0.9s infinite alternate; }
@keyframes pulseW { from { opacity: 0.76; } to { opacity: 1; } }

@media (max-width: 480px) {
  .m-chip { padding: 2px 6px; font-size: 10.5px; gap: 3px; }
  #moodChip { display: none; }
}
@media (max-width: 420px) {
  #hudTop { max-width: calc(100vw - 110px); }
  .hud-card { padding: 6px 8px; }
  .hud-body { gap: 6px; }
  .money-row { gap: 3px; }
  .m-chip { padding: 2px 5px; font-size: 10px; gap: 2.5px; }
}
@media (min-width: 481px) {
  .hero-mood-badge { display: none; }
}

.m-delta {
  position: absolute;
  top: -13px; right: -2px;
  padding: 1px 5.5px; border-radius: 999px;
  background: rgba(8, 15, 28, 0.90);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
  font-size: 10px; font-weight: 800; line-height: 1.25;
  white-space: nowrap; pointer-events: none; z-index: 4;
  animation: deltaPop 1.1s ease-out forwards;
}
@keyframes deltaPop {
  0% { opacity: 1; transform: translateY(2px) scale(1.06); }
  100% { opacity: 0; transform: translateY(-5px) scale(0.96); }
}

.needs-row {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-top: 5px;
}
.need-box {
  display: flex; align-items: center; gap: 3px;
  background: rgba(8, 13, 25, 0.44);
  padding: 2.5px 5px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  cursor: pointer; min-width: 0;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.need-box:hover { background: rgba(255, 255, 255, 0.10); border-color: rgba(255, 255, 255, 0.24); }
.need-box.low {
  border-color: rgba(251, 113, 133, 0.72);
  background: rgba(159, 18, 57, 0.36);
  animation: pulseW 0.75s infinite alternate;
}
.need-box span { font-size: 11px; line-height: 1; flex: none; }
.need-bar { flex: 1; height: 5.5px; background: rgba(255, 255, 255, 0.14); border-radius: 999px; overflow: hidden; min-width: 10px; }
.need-bar i { display: block; height: 100%; width: 80%; border-radius: 999px; transition: width 0.25s ease; }

@media (max-width: 480px) {
  .needs-row { gap: 3px; }
  .need-box { padding: 3.5px 3.5px; gap: 2px; min-height: 21px; }
}

.need-tip {
  margin-top: 6px; padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 11px; color: #bae6fd; font-weight: 600;
  display: flex; align-items: center; gap: 5px;
}

/* ---------- Верхній Правий Острів (#topRight: Мінімапа + Мобільні Утиліти) ---------- */
#topRight {
  position: absolute;
  top: calc(8px + env(safe-area-inset-top, 0px));
  right: calc(8px + env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  pointer-events: none;
}

#miniWrap {
  width: 102px;
  background: var(--glass-hud);
  border: 1px solid var(--line-hi);
  border-radius: 18px;
  padding: 5px;
  box-shadow: var(--spec-rim), var(--shadow-float);
  pointer-events: auto; cursor: pointer;
  transition: transform 0.16s ease, border-color 0.2s ease;
}
#miniWrap:hover { transform: translateY(-1px); border-color: rgba(125, 211, 252, 0.65); }
#miniWrap:active { transform: scale(0.97); }
#mm {
  width: 100%; height: auto; aspect-ratio: 208 / 172; display: block;
  border-radius: 12px; background: #0d1526;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.mm-lbl { font-size: 9.5px; color: var(--muted); text-align: center; margin-top: 3px; font-weight: 600; letter-spacing: 0.01em; }

.mini-quick {
  display: flex; gap: 5px; pointer-events: auto;
}
.util-btn {
  width: 34px; height: 34px; padding: 0;
  border-radius: 50%;
  background: var(--glass-hud);
  border: 1px solid var(--line-hi);
  box-shadow: var(--spec-rim), 0 6px 18px rgba(4, 9, 22, 0.38);
  color: var(--txt);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.util-btn:active { transform: scale(0.93); }

@media (max-width: 420px) {
  #miniWrap { width: 92px; padding: 4px; border-radius: 16px; }
  .mm-lbl { font-size: 9px; }
}
@media (min-width: 760px) {
  #hudTop { left: calc(12px + env(safe-area-inset-left, 0px)); top: calc(10px + env(safe-area-inset-top, 0px)); max-width: 486px; }
  .hud-card { padding: 8px 11px; border-radius: 22px; }
  .hero-btn { width: 50px; height: 50px; border-radius: 16px; }
  #heroAvatarCv { border-radius: 14.5px; }
  #topRight { right: calc(12px + env(safe-area-inset-right, 0px)); top: calc(10px + env(safe-area-inset-top, 0px)); }
  #miniWrap { width: 160px; padding: 6px; border-radius: 20px; }
  .mm-lbl { font-size: 10.5px; }
  .mini-quick { display: none; }
}

/* ---------- Плаваючі Контекстні Капсули Дії (#ctxWrap / Dynamic Islands) ---------- */
#ctxWrap {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  display: flex; gap: 5px; align-items: center; justify-content: center; flex-wrap: wrap;
  max-width: calc(100vw - 16px);
  z-index: 15; pointer-events: auto;
}
body.build-on #ctxWrap { display: none; }

.ctx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 15px; border-radius: 999px;
  border: 1px solid rgba(186, 230, 253, 0.72);
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.90) 0%, rgba(3, 105, 161, 0.94) 100%);
  color: #ffffff;
  font: 700 13px/1.15 'Rubik', sans-serif;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42), 0 10px 26px rgba(3, 105, 161, 0.40);
  cursor: pointer; max-width: calc(100vw - 18px); white-space: normal; text-align: center;
  transition: transform 0.15s ease, filter 0.15s ease;
}
@media (max-width: 759px) {
  .ctx-btn { font-size: 12.2px; padding: 8px 13px; min-height: 36px; }
  .ctx-btn span { min-width: 0; overflow-wrap: anywhere; }
}
.ctx-btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.ctx-btn.danger {
  border-color: rgba(253, 164, 175, 0.75);
  background: linear-gradient(180deg, rgba(225, 29, 72, 0.90) 0%, rgba(159, 18, 57, 0.95) 100%);
  color: #fff1f2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36), 0 10px 26px rgba(190, 18, 60, 0.42);
}
.ctx-btn.subtle {
  border-color: var(--line-hi);
  background: var(--glass-hud);
  color: #f1f5f9; font-size: 12px; font-weight: 600; padding: 8.5px 13px;
  box-shadow: var(--spec-rim), var(--shadow-float);
}
.ctx-btn:active { transform: scale(0.96); }
.ctx-kbd {
  display: none;
  padding: 2px 5px; border-radius: 6px;
  background: rgba(15, 23, 42, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 10px; font-weight: 700; line-height: 1;
}
@media (min-width: 900px) {
  #ctxWrap { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
  .ctx-kbd { display: inline-block; }
}

/* ---------- Панель Будівництва (#buildBar — плавно замінює нижній док!) ---------- */
#buildBar {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  width: min(740px, calc(100vw - 12px));
  max-width: calc(100vw - 12px);
  box-sizing: border-box;
  overflow: hidden;
  background: var(--glass-modal);
  border: 1px solid rgba(125, 211, 252, 0.44);
  border-radius: 22px;
  padding: 8px 10px 9px;
  box-shadow: var(--spec-rim), 0 18px 44px rgba(2, 6, 18, 0.62);
  pointer-events: auto; z-index: 18;
  animation: sheetUp 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes sheetUp {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.bb-top {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  margin-bottom: 6px; min-width: 0;
}
.bb-title {
  font-size: 13px; font-weight: 700; color: #f8fafc; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
.bb-title small { color: #bae6fd; font-weight: 600; font-size: 11.5px; margin-left: 2px; }
@media (max-width: 460px) {
  .bb-title small { display: none; }
}
.bb-act { display: flex; align-items: center; gap: 4px; flex: none; min-width: 0; }
#rotTxt {
  display: inline-block; min-width: 24px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.bb-head {
  display: flex; align-items: center; gap: 5px;
  overflow-x: auto; scrollbar-width: none; padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.bb-head::-webkit-scrollbar { display: none; }
.bb-tab {
  flex: none; padding: 5px 10px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.07);
  color: #e2e8f0; font: 600 11.5px 'Rubik', sans-serif; cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.bb-tab:hover { background: rgba(255, 255, 255, 0.13); }
.bb-tab.on {
  background: rgba(56, 189, 248, 0.32);
  color: #ffffff;
  border-color: rgba(125, 211, 252, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 0 14px rgba(56, 189, 248, 0.24);
}
#btnFurnStudio {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(125, 211, 252, 0.48);
  color: #e0f2fe;
}
#btnFurnStudio:hover {
  background: rgba(56, 189, 248, 0.28);
  border-color: rgba(125, 211, 252, 0.75);
}
.bb-tab.close {
  background: rgba(244, 63, 94, 0.20); color: #fecdd3;
  border-color: rgba(251, 113, 133, 0.45); padding: 5px 8.5px;
}
.bb-tab.close:hover { background: rgba(244, 63, 94, 0.34); }

@media (max-width: 759px) {
  body.build-on #miniWrap { display: none; }
  body.build-on #hudTop .needs-row,
  body.build-on #dutyHud { display: none; }
  body.build-on #topRight .mini-quick { flex-direction: row; }
  body.build-on #hudTop { max-width: calc(100vw - 96px); }
}
.phone-only { display: none !important; }
body.phone .phone-only:not(.hidden) { display: inline-flex !important; }
.phone-erase-tab { display: none; }
@media (max-width: 540px) {
  .desk-only-sm { display: none !important; }
  .phone-erase-tab { display: inline-flex; }
  #buildBar { padding: 7px 8px 8px; border-radius: 19px; }
  .bb-top { gap: 4px; }
  .bb-title { font-size: 12px; gap: 4px; }
  .bb-act { gap: 4px; }
  .bb-act .bb-tab {
    min-height: 31px;
    padding: 4.5px 7.5px;
    font-size: 10.8px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
  }
  #btnBuildNav.on {
    background: rgba(56, 189, 248, 0.34);
    border-color: rgba(125, 211, 252, 0.85);
    color: #fff;
  }
  #btnPropCfg { font-size: 0; gap: 0; padding: 4.5px 8px; min-width: 32px; }
  #btnBuildClose { padding: 4.5px 8.5px; min-width: 32px; }
}
@media (max-width: 440px) {
  #btnEraseQuick { font-size: 0; gap: 0; padding: 4.5px 7px; }
  .bb-item { width: 98px; padding: 5px 6px; border-radius: 13px; }
  .bb-thumb-wrap { height: 42px; }
  .bb-thumb { width: 40px; height: 40px; }
}
@media (max-width: 375px) {
  .bb-title { font-size: 0; gap: 0; }
}

.bb-items {
  display: flex; gap: 7px; overflow-x: auto; overflow-y: hidden;
  padding: 8px 2px 7px;
  scroll-behavior: auto;
}
.bb-items::-webkit-scrollbar,
.m-body::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.bb-items::-webkit-scrollbar-button,
.m-body::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}
.bb-items::-webkit-scrollbar-corner,
.m-body::-webkit-scrollbar-corner {
  background: transparent;
}
.bb-items::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.055);
  border-radius: 999px;
  margin: 0 6px;
}
.m-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  margin: 6px 0;
}
.bb-items::-webkit-scrollbar-thumb,
.m-body::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.40), rgba(125, 211, 252, 0.46));
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.bb-items::-webkit-scrollbar-thumb:hover,
.m-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, rgba(125, 211, 252, 0.66), rgba(56, 189, 248, 0.74));
  border-color: rgba(186, 230, 253, 0.46);
}
@media (hover: none) and (pointer: coarse) {
  .bb-items::-webkit-scrollbar { height: 3px; }
}
@supports not selector(::-webkit-scrollbar) {
  .bb-items,
  .m-body {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.42) rgba(255, 255, 255, 0.05);
  }
}
.bb-item {
  flex: none; width: 110px; padding: 6px 7px; border-radius: 15px;
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: var(--txt); text-align: left; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between; gap: 3px;
  position: relative; overflow: hidden; box-sizing: border-box;
  transition: transform 0.14s ease, border-color 0.16s ease, background 0.16s ease;
}
.bb-item:hover { background: rgba(255, 255, 255, 0.11); border-color: rgba(125, 211, 252, 0.48); transform: translateY(-1px); }
.bb-item.on {
  border-color: rgba(251, 191, 36, 0.85);
  background: rgba(251, 191, 36, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 0 16px rgba(251, 191, 36, 0.22);
}
.bb-thumb-wrap {
  width: 100%; height: 48px; border-radius: 10px;
  background: radial-gradient(circle at 50% 55%, rgba(56, 189, 248, 0.18), rgba(8, 13, 25, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.bb-thumb { width: 46px; height: 46px; object-fit: contain; display: block; pointer-events: none; }
.bb-item b {
  font-size: 11px; font-weight: 600; line-height: 1.18; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bb-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1px 4px; width: 100%; }
.bb-item small { font-size: 10.5px; color: #fde68a; font-weight: 700; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.bb-stat { font-size: 9.5px; color: #bae6fd; font-weight: 600; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.bb-item.bb-erase-card {
  flex: 1 1 136px; min-width: 0; width: auto; max-width: 210px;
}
.bb-item.bb-erase-card small {
  white-space: normal; overflow: visible; line-height: 1.22; color: #cbd5e1; font-weight: 500;
}
.bb-own {
  position: absolute; top: 5px; right: 5px;
  background: rgba(16, 185, 129, 0.92); color: #022c22;
  font-size: 9.5px; font-weight: 800; padding: 1px 5.5px; border-radius: 999px;
}

/* ---------- Нижній Док (#dock — Frosted Glass OS Dock) ---------- */
#dock {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 6px;
  max-width: calc(100vw - 14px);
  overflow-x: auto; scrollbar-width: none;
  background: var(--glass-hud);
  border: 1px solid var(--line-hi);
  border-radius: 22px;
  padding: 5px 7px;
  box-shadow: var(--spec-rim), var(--shadow-float);
  pointer-events: auto;
  transition: opacity 0.2s ease, transform 0.22s ease, border-color 0.25s ease;
}
#dock::-webkit-scrollbar { display: none; }
body.build-on #dock {
  opacity: 0;
  transform: translate(-50%, 20px) scale(0.96);
  pointer-events: none;
}

.dock-btn {
  flex: none; min-width: 52px; height: 48px; padding: 0 10px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.065);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  color: var(--txt);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.5px;
  cursor: pointer; position: relative; font-family: inherit;
  transition: transform 0.15s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.dock-btn:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1.5px);
}
.dock-btn:active { transform: scale(0.95); }
.dock-btn.active {
  background: rgba(56, 189, 248, 0.30);
  border-color: rgba(125, 211, 252, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 16px rgba(56, 189, 248, 0.25);
  color: #ffffff;
}
.dock-btn.active .lb { color: #e0f2fe; }
.dock-btn .ic { font-size: 16px; line-height: 1; }
.dock-btn .lb { font-size: 10px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.dock-btn kbd {
  display: none; position: absolute; top: 3px; right: 5px;
  font-size: 8.5px; font-weight: 600; color: rgba(226, 232, 240, 0.58); font-family: inherit;
}

@media (max-width: 759px) {
  .desk-only { display: none !important; }
  #dock {
    width: min(420px, calc(100vw - 10px));
    justify-content: space-between;
    gap: 3px;
    padding: 4px;
    border-radius: 20px;
  }
  .dock-btn {
    flex: 1 1 0;
    min-width: 0;
    height: 46px;
    padding: 0 1px;
    border-radius: 14px;
    gap: 2px;
  }
  .dock-btn .lb { font-size: 9px; letter-spacing: -0.02em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
}
@media (min-width: 390px) and (max-width: 759px) {
  .dock-btn .lb { font-size: 9.4px; }
}

@media (min-width: 900px) {
  #dock { padding: 6px 8px; gap: 6px; border-radius: 24px; }
  .dock-btn { min-width: 68px; height: 50px; padding: 0 12px; border-radius: 16px; }
  .dock-btn .lb { font-size: 10.5px; }
  .dock-btn kbd { display: block; }
}

/* ---------- Чат і Лог Подій (#chatBox) ---------- */
#chatBox {
  position: absolute;
  left: calc(10px + env(safe-area-inset-left, 0px));
  bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  width: min(344px, calc(100vw - 20px));
  pointer-events: none;
  display: flex; flex-direction: column; gap: 6px;
  transition: bottom 0.18s ease;
}
body.phone.has-ctx #chatBox {
  bottom: calc(118px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 900px) {
  #chatBox, body.phone.has-ctx #chatBox { left: 14px; bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
}
body.build-on #chatLog { display: none; }
#chatLog {
  max-height: 104px; overflow-y: auto; scrollbar-width: none;
  padding-top: 4px;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px;
}
#chatLog::-webkit-scrollbar { display: none; }
.clog-line {
  background: rgba(11, 18, 34, 0.80);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 4px 10px; border-radius: 12px; width: fit-content; max-width: 100%; word-break: break-word;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}
#chatForm {
  display: flex; gap: 6px; pointer-events: auto; align-items: center;
}
#chatInp {
  flex: 1; min-width: 0; height: 40px; border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.58);
  background: rgba(10, 16, 30, 0.90);
  box-shadow: var(--spec-rim), 0 8px 24px rgba(0, 0, 0, 0.4);
  color: #fff; padding: 0 14px; font: 13.5px 'Rubik', sans-serif; outline: none;
}
#chatSend {
  height: 40px; width: 42px; padding: 0; border-radius: 50%; flex: none;
  border: 1px solid rgba(186, 230, 253, 0.72);
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.88), rgba(2, 132, 199, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 6px 18px rgba(14, 165, 233, 0.35);
  color: #ffffff; cursor: pointer;
}
#chatClose {
  height: 40px; width: 40px; padding: 0; border-radius: 50%; flex: none;
  border: 1px solid rgba(255, 255, 255, 0.20);
  background: rgba(15, 23, 42, 0.88);
  color: #cbd5e1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
#chatClose:active { transform: scale(0.94); }
body.phone #chatLog {
  max-height: 60px; font-size: 11px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 100%);
}
body.phone #chatBox.open #chatLog {
  -webkit-mask-image: none;
  mask-image: none;
}

/* ---------- Міні-Ігри Видобутку та Риболовлі (#mgBox) ---------- */
#mgBox {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(118px + env(safe-area-inset-bottom, 0px));
  z-index: 35;
  width: min(378px, calc(100vw - 20px));
  padding: 11px 14px 10px;
  border-radius: 22px;
  background: var(--glass-modal);
  border: 1px solid rgba(125, 211, 252, 0.55);
  box-shadow: var(--spec-rim), 0 16px 38px rgba(3, 8, 20, 0.55);
  color: var(--txt);
  font: 600 13px 'Rubik', system-ui, sans-serif;
  touch-action: none; user-select: none; cursor: pointer;
}
#mgBox .mg-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; gap: 8px; }
#mgBox .mg-top b { font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
#mgBox .mg-res { color: #fde68a; font-weight: 700; min-height: 16px; display: inline-flex; align-items: center; gap: 4px; }
#mgBox canvas { display: block; width: 100%; height: 54px; border-radius: 12px; }
#mgBox .mg-hint { margin-top: 6px; font-size: 11.5px; font-weight: 500; color: var(--muted); text-align: center; }
body.phone #mgBox { bottom: calc(108px + env(safe-area-inset-bottom, 0px)); }

/* ---------- Віртуальний Джойстик (#joy) ---------- */
#joy {
  position: fixed; width: 106px; height: 106px; margin: -53px 0 0 -53px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.34);
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 8px 24px rgba(0, 0, 0, 0.3);
  display: none; pointer-events: none; z-index: 12;
}
#joy i {
  position: absolute; left: 50%; top: 50%; width: 42px; height: 42px; margin: -21px 0 0 -21px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(186, 230, 253, 0.95), rgba(14, 165, 233, 0.82));
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.55);
}
#joy.on { display: block; }

/* ---------- Спливаючі Сповіщення (#toasts — Frosted Dynamic Pills) ---------- */
#toasts {
  position: fixed; top: var(--toast-top, calc(106px + env(safe-area-inset-top, 0px))); left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  z-index: 65; pointer-events: none; width: min(440px, calc(100vw - 24px));
  transition: top 0.16s ease;
}
@media (min-width: 960px) {
  #toasts { top: calc(14px + env(safe-area-inset-top, 0px)); }
}
/* Ховаємо бічний язичок порталу «AD», щоб він не різав модалки й палітру будови */
body.modal-open .adp-tab,
body.creator-open .adp-tab,
body.build-on .adp-tab {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateX(-120%);
}
.vc-toast {
  background: rgba(10, 16, 30, 0.90);
  border: 1px solid var(--line-hi);
  padding: 8.5px 16px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  box-shadow: var(--spec-rim), 0 12px 28px rgba(0, 0, 0, 0.46);
  text-align: center;
  animation: toastIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.vc-toast.good { border-color: rgba(110, 231, 183, 0.62); color: #d1fae5; background: rgba(6, 56, 46, 0.92); }
.vc-toast.warn { border-color: rgba(253, 164, 175, 0.65); color: #ffe4e6; background: rgba(68, 14, 30, 0.92); }
@keyframes toastIn { from { transform: translateY(-10px) scale(0.96); opacity: 0; } }

/* ---------- Модальні Вікна (Frosted Glass OS / Mobile Bottom Sheet) ---------- */
.modal-ov {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(4, 9, 20, 0.48);
  backdrop-filter: blur(8px) saturate(125%);
  -webkit-backdrop-filter: blur(8px) saturate(125%);
  display: flex; align-items: flex-end; justify-content: center;
  pointer-events: auto;
}
@media (min-width: 760px) {
  .modal-ov { align-items: center; padding: 18px; }
}

.modal-box {
  width: 100%; max-width: 700px; max-height: 90dvh;
  background: var(--glass-modal);
  backdrop-filter: blur(8px) saturate(130%);
  -webkit-backdrop-filter: blur(8px) saturate(130%);
  border: 1px solid var(--line-hi);
  border-bottom: none;
  border-radius: 26px 26px 0 0;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--spec-rim), 0 28px 68px rgba(2, 6, 18, 0.68);
  animation: modalSheet 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes modalSheet {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Мобільна оптимізація GPU-композитора: без десятків окремих backdrop-filter поверх 60fps Canvas */
body.phone {
  --glass-hud: linear-gradient(155deg, rgba(15, 24, 44, 0.90) 0%, rgba(9, 15, 29, 0.95) 100%);
  --glass-modal: linear-gradient(162deg, rgba(15, 24, 44, 0.95) 0%, rgba(9, 15, 28, 0.98) 100%);
}
body.phone .hud-card,
body.phone #miniWrap,
body.phone .util-btn,
body.phone .ctx-btn,
body.phone #buildBar,
body.phone #dock,
body.phone #chatInp,
body.phone #mgBox,
body.phone #joy,
body.phone .vc-toast,
body.phone .modal-ov,
body.phone .modal-box,
body.phone .soc-invite-card,
body.phone .duty-pill,
body.phone .buff-pill {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body.phone #joy { background: rgba(15, 23, 42, 0.34); }
body.phone #chatInp { background: rgba(12, 20, 38, 0.92); }
body.phone .vc-toast { background: rgba(14, 23, 42, 0.93); }
body.phone .vc-toast.good { background: rgba(6, 56, 46, 0.93); }
body.phone .vc-toast.warn { background: rgba(68, 14, 30, 0.94); }
body.phone .modal-ov { background: rgba(4, 9, 20, 0.62); }

.m-sheet-handle {
  width: 38px; height: 4px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  margin: 8px auto 0; flex: none;
}

@media (min-width: 760px) {
  .modal-box {
    border-bottom: 1px solid var(--line-hi);
    border-radius: 24px;
    max-height: 86vh;
    animation: modalPop 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
  }
  .modal-box[data-mkind="char"],
  .modal-box[data-mkind="loot_bag"],
  .modal-box[data-mkind="map"],
  .modal-box[data-mkind="wardrobe"],
  .modal-box[data-mkind="jobs"],
  .modal-box[data-mkind="homes"],
  .modal-box[data-mkind="shop_furn"],
  .modal-box[data-mkind="npc_contacts"],
  .modal-box[data-mkind="npc_talk"],
  .modal-box[data-mkind="creator"] {
    max-width: 790px;
  }
  .m-sheet-handle { display: none; }
}
@keyframes modalPop {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.m-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 16px; min-width: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01));
}
.m-head h2 { margin: 0; font-size: 16px; font-weight: 700; display: inline-flex; align-items: center; gap: 7px; min-width: 0; flex: 1 1 auto; letter-spacing: -0.01em; }
.m-head h2 span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) {
  .m-head { padding: 9px 12px; gap: 6px; }
  .m-head h2 { font-size: 14px; gap: 5px; }
}

.m-head-right { display: flex; align-items: center; gap: 8px; flex: none; max-width: 58%; }
.m-wallet {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4.5px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
  max-width: 100%; overflow: hidden;
}
@media (max-width: 440px) {
  .m-head-right { gap: 5px; }
  .m-wallet { padding: 3px 6.5px; font-size: 10px; gap: 4px; }
}
.m-close {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.09);
  color: #e2e8f0; cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
@media (max-width: 520px) {
  .m-close { width: 38px; height: 38px; }
}
.m-close:hover { background: rgba(255, 255, 255, 0.18); color: #ffffff; }
.m-close:active { transform: scale(0.93); }

.can-scroll-r {
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 26px), transparent 100%);
  mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 26px), transparent 100%);
}
.m-tabs {
  display: flex; gap: 6px; padding: 8px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(6, 11, 22, 0.22);
  overflow-x: auto; scrollbar-width: none; flex: none;
}
.m-tabs::-webkit-scrollbar { display: none; }
.m-tab {
  flex: none; padding: 6.5px 13px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.065);
  color: var(--muted); font: 600 12px 'Rubik', sans-serif; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.m-tab:hover { background: rgba(255, 255, 255, 0.12); color: #ffffff; }
.m-tab.on {
  background: rgba(56, 189, 248, 0.30);
  color: #ffffff;
  border-color: rgba(125, 211, 252, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), 0 0 16px rgba(56, 189, 248, 0.24);
}
@media (max-width: 520px) {
  .m-tabs { padding: 6px 9px; gap: 4px; }
  .m-tab { padding: 5.5px 7px; font-size: 10.8px; gap: 3px; white-space: nowrap; }
  .modal-box[data-mkind="char"] .m-tab,
  .modal-box[data-mkind="jobs"] .m-tab,
  .modal-box[data-mkind="homes"] .m-tab,
  .modal-box[data-mkind="wardrobe"] .m-tab,
  .modal-box[data-mkind="npc_contacts"] .m-tab,
  .modal-box[data-mkind="furn_studio"] .m-tab { flex: 1 1 auto; justify-content: center; }
}

.m-body {
  padding: 14px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto; overflow-x: hidden; flex: 1; user-select: text;
}
@media (max-width: 440px) {
  .m-body { padding: 11px 12px calc(18px + env(safe-area-inset-bottom, 0px)); }
}

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 10px; }
.grid-cards > *, .g-card, .fstu-card, .tpl-card, .furn-show-card, .job-card, .order-ticket {
  min-width: 0; max-width: 100%; box-sizing: border-box;
}
@media (max-width: 520px) {
  .grid-cards { grid-template-columns: 1fr; gap: 8px; }
}
.g-card {
  background: var(--glass-card);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  border-radius: 16px; padding: 12px 13px;
  display: flex; flex-direction: column; gap: 6px;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.g-card:hover { background: var(--glass-card-hov); border-color: rgba(255, 255, 255, 0.22); }
.g-card-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 8px; min-width: 0; }
.g-card-top > b, .g-card-top > span { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.g-card b { font-size: 13.5px; }
.g-card p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.4; }

.xp-bar { height: 7px; border-radius: 999px; background: rgba(5, 10, 20, 0.52); border: 1px solid rgba(255, 255, 255, 0.08); overflow: hidden; }
.xp-bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 7px 14px; border-radius: 12px;
  max-width: 100%; box-sizing: border-box; white-space: normal; text-align: center; line-height: 1.22;
  border: 1px solid rgba(255, 255, 255, 0.20);
  background: rgba(255, 255, 255, 0.095);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: #ffffff; font: 600 13px/1.22 'Rubik', sans-serif; cursor: pointer;
  transition: transform 0.14s ease, filter 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}
.btn:hover { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.30); }
.btn:active { transform: scale(0.97); }
.btn.pri {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.84) 0%, rgba(2, 132, 199, 0.88) 100%);
  border-color: rgba(186, 230, 253, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.40), 0 6px 18px rgba(14, 165, 233, 0.28);
}
.btn.pri:hover { filter: brightness(1.07); }
.btn.green {
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.84) 0%, rgba(5, 150, 105, 0.90) 100%);
  border-color: rgba(167, 243, 208, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36), 0 6px 18px rgba(16, 185, 129, 0.26);
}
.btn.danger {
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.84) 0%, rgba(190, 18, 60, 0.90) 100%);
  border-color: rgba(253, 164, 175, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 6px 18px rgba(225, 29, 72, 0.28);
}
.btn.sm { min-height: 34px; padding: 5px 10px; font-size: 12px; border-radius: 10px; }
.btn:disabled,
.btn[disabled] {
  opacity: 0.42;
  filter: grayscale(0.45);
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
  transform: none;
}

.inp {
  width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box;
  height: 42px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(8, 13, 25, 0.58);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
  color: #fff; padding: 0 13px; font: 14px 'Rubik', sans-serif; outline: none;
  transition: border-color 0.16s ease;
}
.inp:focus { border-color: rgba(125, 211, 252, 0.72); }

/* ---------- Створення Персонажа та Жива Примірочна Гардеробу ---------- */
.creator-layout, .ward-layout { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) {
  .creator-layout { grid-template-columns: 204px 1fr; gap: 16px; }
  .ward-layout { grid-template-columns: 204px 1fr; gap: 16px; align-items: start; }
}
.creator-prev, .ward-prev {
  background: radial-gradient(circle at 50% 32%, rgba(56, 189, 248, 0.18), rgba(9, 15, 28, 0.58));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  border-radius: 20px; padding: 10px 12px;
  display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px;
}
.mannequin-stage {
  display: flex; flex-direction: column; align-items: center; gap: 5px; flex: none;
}
#createCv, #wardrobeCv { width: 98px; height: 114px; display: block; }
@media (min-width: 640px) {
  .creator-prev, .ward-prev { flex-direction: column; justify-content: center; padding: 14px 12px; gap: 9px; text-align: center; }
  .ward-prev { position: sticky; top: 0; }
  #createCv, #wardrobeCv { width: 158px; height: 182px; }
}
@media (max-width: 639px) {
  .ward-prev {
    position: sticky; top: -11px; z-index: 6;
    background: linear-gradient(155deg, rgba(16, 28, 52, 0.98), rgba(9, 15, 29, 0.99));
    padding: 8px 10px; gap: 10px; border-radius: 16px;
    box-shadow: 0 10px 24px rgba(2, 6, 18, 0.72);
  }
  #wardrobeCv { width: 74px; height: 86px; }
  .ward-prev-actions { flex-direction: row !important; flex-wrap: wrap; }
  .ward-prev-actions .btn.sm { flex: 1 1 auto; min-height: 30px; padding: 4px 8px; font-size: 11px; }
  .ward-try-note { display: none; }
}
@media (min-width: 380px) and (max-width: 520px) {
  .ward-clothes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 7px !important; }
  .ward-clothes-grid .g-card { padding: 9px 9px; gap: 5px; }
  .ward-clothes-grid .g-card-top b { font-size: 12.2px; }
}
.rot-row { display: flex; gap: 6px; }
.rot-btn {
  width: 32px; height: 28px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.20);
  background: rgba(255, 255, 255, 0.09);
  color: #e2e8f0; font-size: 11px; cursor: pointer;
}
.rot-btn:hover { background: rgba(255, 255, 255, 0.18); border-color: rgba(125, 211, 252, 0.65); color: #fff; }

.cr-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cr-name { font-weight: 700; color: #bae6fd; font-size: 15px; }
.cr-sub { color: var(--muted); line-height: 1.35; font-size: 11.5px; }
.cr-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.cr-style-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cr-sec-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; font-size: 13px; font-weight: 700; }
.cr-pts-badge {
  font-size: 12px; font-weight: 700; color: #fde68a;
  padding: 2.5px 9px; border-radius: 999px;
  background: rgba(251, 191, 36, 0.16); border: 1px solid rgba(251, 191, 36, 0.42);
}
.cr-start-btn { width: 100%; margin-top: 10px; min-height: 48px; font-size: 15px; border-radius: 15px; }

.net-msg { margin: 0 0 14px; line-height: 1.48; color: var(--muted); font-size: 13.5px; }
.net-btns { display: flex; gap: 8px; flex-wrap: wrap; }

.swatch-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 11px; }
.swatch {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.25), 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer; transition: transform 0.15s ease, border-color 0.15s ease;
}
.swatch.on { border-color: #ffffff; transform: scale(1.14); box-shadow: 0 0 12px rgba(186, 230, 253, 0.65); }

.attr-alloc-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 10px;
  background: var(--glass-card);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 13px; margin-bottom: 5px;
}
.attr-alloc-row .attr-lbl { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.attr-alloc-row .attr-lbl small { font-size: 10.5px; color: var(--subtle); }
.attr-alloc-row .ctrl { display: flex; align-items: center; gap: 8px; flex: none; }
.attr-alloc-row button {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.20);
  background: rgba(255, 255, 255, 0.09);
  color: #fff; font-weight: 700; font-size: 16px; cursor: pointer;
}
.attr-alloc-row button:hover { background: rgba(255, 255, 255, 0.18); }

.furn-show-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 10px;
}
@media (max-width: 520px) {
  .furn-show-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}
@media (max-width: 345px) {
  .furn-show-grid { grid-template-columns: 1fr; }
}
.furn-show-card {
  background: var(--glass-card);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  border-radius: 16px; padding: 10px;
  display: flex; flex-direction: column; gap: 5px; align-items: center; text-align: center;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}
.furn-show-card:hover { background: var(--glass-card-hov); border-color: rgba(125, 211, 252, 0.42); transform: translateY(-1px); }
.furn-show-card img { width: 58px; height: 58px; object-fit: contain; }

/* ---------- Векторні Іконки ВіртСіті (.vc-ic) ---------- */
.vc-ic {
  display: inline-block;
  vertical-align: -0.18em;
  flex: none;
  pointer-events: none;
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.36));
}
#clockTxt, .bb-tab, .btn, .m-close, .rot-btn, #chatSend {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.need-box span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dock-btn .ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
}
.m-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.m-wallet span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.vc-toast {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.g-card-top b, .g-card-top span, .attr-alloc-row .attr-lbl > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ---------- Кар’єра та Бажання (Frosted Glass OS Jobs & Wishes) ---------- */
.jobs-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 10px 13px; margin-bottom: 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.13), rgba(15, 23, 42, 0.42));
  border: 1px solid rgba(125, 211, 252, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.jobs-banner.nature {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.14), rgba(15, 23, 42, 0.42));
  border-color: rgba(110, 231, 183, 0.28);
}
.jobs-banner.ghetto {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.18), rgba(15, 23, 42, 0.48));
  border-color: rgba(253, 164, 175, 0.34);
}
.jobs-banner.wishes {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(15, 23, 42, 0.42));
  border-color: rgba(253, 224, 71, 0.28);
}
.jobs-banner-txt {
  font-size: 12.2px; color: #e2e8f0; line-height: 1.38;
  display: inline-flex; align-items: center; gap: 7px; flex: 1 1 220px;
}
.jobs-banner-badges {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.jb-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3.5px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
}
.jb-pill.happy { background: rgba(16, 185, 129, 0.22); border-color: rgba(110, 231, 183, 0.5); color: #a7f3d0; }
.jb-pill.tired { background: rgba(244, 63, 94, 0.22); border-color: rgba(253, 164, 175, 0.5); color: #fecdd3; }

.jobs-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
}
@media (max-width: 640px) {
  .jobs-grid { grid-template-columns: 1fr; gap: 9px; }
}

.job-card {
  background: var(--glass-card);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  border-radius: 16px; padding: 12px 13px;
  display: flex; flex-direction: column; gap: 9px;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}
.job-card:hover { background: var(--glass-card-hov); border-color: rgba(255, 255, 255, 0.24); }
.job-card.at-spot {
  border-color: rgba(52, 211, 153, 0.62);
  background: linear-gradient(160deg, rgba(16, 185, 129, 0.14), rgba(15, 23, 42, 0.46));
  box-shadow: inset 0 1px 0 rgba(167, 243, 208, 0.22), 0 8px 22px rgba(5, 150, 105, 0.16);
}
.job-card.ghetto { border-color: rgba(251, 113, 133, 0.30); }
.job-card.ghetto.at-spot {
  border-color: rgba(251, 191, 36, 0.65);
  background: linear-gradient(160deg, rgba(245, 158, 11, 0.15), rgba(38, 12, 24, 0.52));
}
.job-card.locked { opacity: 0.86; }

.job-top { display: flex; align-items: flex-start; gap: 10px; }
.job-ico {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(125, 211, 252, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.job-ico.nature { background: rgba(52, 211, 153, 0.15); border-color: rgba(110, 231, 183, 0.30); }
.job-ico.ghetto { background: rgba(244, 63, 94, 0.17); border-color: rgba(253, 164, 175, 0.32); }

.job-headings { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.job-title { font-size: 13.8px; font-weight: 700; color: #f8fafc; line-height: 1.22; }
.job-loc {
  font-size: 11.4px; color: #94a3b8; line-height: 1.35;
}
.job-loc .vc-ic { vertical-align: -2px; margin-right: 3px; }
.job-loc .job-here-pill { margin-left: 5px; vertical-align: 1px; }
.job-here-pill {
  padding: 1.5px 7px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.01em;
  background: rgba(16, 185, 129, 0.26);
  border: 1px solid rgba(110, 231, 183, 0.55);
  color: #a7f3d0;
}

.job-pay {
  flex: none; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
}
.job-pay-val {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3.5px 9px; border-radius: 999px;
  font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.job-pay-val.card {
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(125, 211, 252, 0.36);
  color: #bae6fd;
}
.job-pay-val.cash {
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid rgba(253, 224, 71, 0.42);
  color: #fde68a;
}
.job-pay-sub { font-size: 10.5px; color: #94a3b8; font-variant-numeric: tabular-nums; }

.job-desc { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.38; }

.job-specs { display: flex; flex-wrap: wrap; gap: 5px; }
.j-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 8px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: #cbd5e1;
}
.j-pill.ok { background: rgba(16, 185, 129, 0.15); border-color: rgba(110, 231, 183, 0.38); color: #a7f3d0; }
.j-pill.lock { background: rgba(244, 63, 94, 0.16); border-color: rgba(253, 164, 175, 0.42); color: #fecdd3; }
.j-pill.skill { background: rgba(56, 189, 248, 0.12); border-color: rgba(125, 211, 252, 0.25); color: #bae6fd; }
.j-pill.bonus { background: rgba(251, 191, 36, 0.14); border-color: rgba(253, 224, 71, 0.34); color: #fde68a; }

.job-foot {
  margin-top: auto; padding-top: 2px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
}
.job-foot .job-act-btn { flex: 1 1 auto; }
.job-dist {
  font-size: 11px; color: #94a3b8; font-variant-numeric: tabular-nums; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
}
.job-lock-note {
  font-size: 11.5px; font-weight: 600; color: #fda4af;
  display: inline-flex; align-items: center; gap: 5px; flex: 1 1 auto;
}

.wishes-list { display: flex; flex-direction: column; gap: 10px; }
.wish-card {
  background: var(--glass-card);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  border-radius: 16px; padding: 13px 14px;
  display: flex; align-items: center; gap: 12px;
}
.wish-card.done {
  border-color: rgba(52, 211, 153, 0.55);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(15, 23, 42, 0.45));
}
.wish-ico {
  width: 42px; height: 42px; border-radius: 13px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(253, 224, 71, 0.32);
}
.wish-card.done .wish-ico {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(110, 231, 183, 0.50);
}
.wish-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.wish-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wish-head b { font-size: 13.8px; color: #f8fafc; }
.wish-rew {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 800; white-space: nowrap;
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid rgba(253, 224, 71, 0.4);
  color: #fde68a;
}
.wish-card.done .wish-rew {
  background: rgba(16, 185, 129, 0.20);
  border-color: rgba(110, 231, 183, 0.45);
  color: #a7f3d0;
}
.wish-desc { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.38; }
.wish-prog-row { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.wish-prog-row .xp-bar { flex: 1; height: 8px; }
.wish-card.done .wish-prog-row .xp-bar i { background: #34d399; }
.wish-prog-lbl { font-size: 11.2px; font-weight: 700; color: #7dd3fc; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wish-card.done .wish-prog-lbl { color: #6ee7b7; }

/* ---------- Паспорт Героя, Характеристики, Навички, Рюкзак і Трофеї (Frosted Glass OS) ---------- */
.char-hero-panel {
  display: grid;
  grid-template-columns: 158px minmax(0, 1fr);
  gap: 13px;
  padding: 12px 13px;
  margin-bottom: 12px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.12), rgba(12, 19, 36, 0.56));
  border: 1px solid rgba(148, 197, 255, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.char-stage-card {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 6px;
  padding: 8px 8px 9px;
  border-radius: 15px;
  background: radial-gradient(circle at 50% 34%, rgba(56, 189, 248, 0.20), rgba(8, 13, 25, 0.56));
  border: 1px solid rgba(255, 255, 255, 0.15);
}
#charPreviewCv { width: 128px; height: 148px; display: block; }
.char-stage-ctrls { display: flex; align-items: center; gap: 5px; width: 100%; justify-content: center; }
.char-stage-ctrls .btn.sm { min-height: 28px; padding: 0 9px; font-size: 11px; border-radius: 999px; }

.char-overview { display: flex; flex-direction: column; gap: 9px; min-width: 0; justify-content: space-between; }
.char-vitals-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
}
.cv-pill {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  padding: 6px 8.5px; border-radius: 11px;
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.13);
  font-size: 11.4px; font-weight: 600; color: #e2e8f0;
  font-variant-numeric: tabular-nums;
}
.cv-pill b { font-size: 11.8px; color: #ffffff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-pill small { font-size: 10.2px; color: #94a3b8; display: block; line-height: 1.1; }
.cv-pill-txt { display: flex; flex-direction: column; min-width: 0; }
.cv-pill.happy { background: rgba(16, 185, 129, 0.17); border-color: rgba(110, 231, 183, 0.42); }
.cv-pill.tired { background: rgba(244, 63, 94, 0.18); border-color: rgba(253, 164, 175, 0.44); }

.char-equip-strip {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.ce-slot {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 31px; padding: 5px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1; font: 600 11.2px 'Rubik', sans-serif;
  cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  max-width: 100%;
}
.ce-slot span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 128px; }
.ce-slot:hover { background: rgba(255, 255, 255, 0.13); border-color: rgba(125, 211, 252, 0.55); color: #ffffff; }
.ce-slot.armed {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(110, 231, 183, 0.52);
  color: #a7f3d0;
}

.char-needs-strip {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px;
}
.cn-item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 5.5px 7px; border-radius: 10px;
  background: rgba(6, 11, 22, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.cn-top {
  display: flex; align-items: center; justify-content: space-between; gap: 3px;
  font-size: 10.6px; font-weight: 700; color: #e2e8f0; font-variant-numeric: tabular-nums;
}
.cn-top span { display: inline-flex; align-items: center; gap: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-item .xp-bar { height: 5.5px; }
.cn-item.low { border-color: rgba(244, 63, 94, 0.52); background: rgba(127, 29, 29, 0.24); }

@media (max-width: 640px) {
  .char-hero-panel {
    grid-template-columns: 1fr;
    gap: 8px; padding: 10px 11px;
  }
  .char-stage-card {
    flex-direction: row; justify-content: space-between; padding: 6px 10px;
  }
  #charPreviewCv { width: 72px; height: 84px; }
  .char-stage-ctrls { width: auto; flex-wrap: wrap; justify-content: flex-end; }
  .char-stage-ctrls .btn.sm, .char-stage-ctrls .rot-btn { min-height: 34px; }
  .char-vitals-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .char-needs-strip { display: none; }
}

.char-sec-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  margin: 2px 0 9px;
}
.char-sec-title {
  font-size: 13.5px; font-weight: 700; color: #f1f5f9;
  display: inline-flex; align-items: center; gap: 6px;
}
.char-life-pills { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

.char-stat-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
}
@media (max-width: 620px) {
  .char-stat-grid { grid-template-columns: 1fr; gap: 8px; }
}
.char-stat-card {
  background: var(--glass-card);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  border-radius: 16px; padding: 11px 13px;
  display: flex; flex-direction: column; gap: 7px;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.char-stat-card:hover { background: var(--glass-card-hov); border-color: rgba(255, 255, 255, 0.24); }
.stat-head { display: flex; align-items: center; gap: 9px; }
.stat-ico {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.20);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.stat-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.stat-titles b { font-size: 13.6px; color: #f8fafc; line-height: 1.2; }
.stat-titles small { font-size: 10.8px; color: #94a3b8; }
.stat-lv-badge {
  flex: none; padding: 3px 8.5px; border-radius: 999px;
  font-size: 11.5px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.stat-prog-row { display: flex; align-items: center; gap: 8px; }
.stat-prog-row .xp-bar { flex: 1; height: 7px; }
.stat-xp-txt { font-size: 10.8px; color: #cbd5e1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-live-pill {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8.5px; border-radius: 8px;
  font-size: 11px; font-weight: 600;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(125, 211, 252, 0.26);
  color: #bae6fd;
}
.stat-desc { margin: 0; font-size: 11.7px; color: var(--muted); line-height: 1.36; }
.stat-train {
  font-size: 10.8px; color: #94a3b8;
  display: inline-flex; align-items: center; gap: 4px;
}

/* ---------- Рюкзак та Особистий Склад Меблів ---------- */
.inv-dash {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 11px 13px; margin-bottom: 10px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.13), rgba(12, 19, 36, 0.50));
  border: 1px solid rgba(125, 211, 252, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.inv-cap-col { flex: 1 1 210px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.inv-cap-top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12.5px; font-weight: 700; color: #f8fafc; font-variant-numeric: tabular-nums;
}
.inv-cap-top span { display: inline-flex; align-items: center; gap: 6px; }
.inv-cap-sub { font-size: 10.8px; color: #94a3b8; }
.inv-cap-bar {
  height: 8px; border-radius: 999px;
  background: rgba(5, 10, 20, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.10);
  overflow: hidden;
}
.inv-cap-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #38bdf8, #22d3ee); transition: width 0.2s ease; }
.inv-cap-bar.warn i { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.inv-cap-bar.full i { background: linear-gradient(90deg, #e11d48, #fb7185); }

.inv-val-box {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}

.inv-filters {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-bottom: 11px;
}
.inv-fbtn {
  min-height: 32px; padding: 5.5px 11px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted); font: 600 11.5px 'Rubik', sans-serif;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
@media (max-width: 520px) {
  .inv-filters {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
  }
  .inv-filters::-webkit-scrollbar { display: none; }
  .inv-fbtn { flex: none; min-height: 34px; padding: 5.5px 10px; }
}
.inv-fbtn:hover { background: rgba(255, 255, 255, 0.12); color: #ffffff; }
.inv-fbtn.on {
  background: rgba(56, 189, 248, 0.26);
  border-color: rgba(125, 211, 252, 0.72);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.inv-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
}
@media (max-width: 620px) {
  .inv-grid { grid-template-columns: 1fr; gap: 8px; }
}
.inv-card {
  background: var(--glass-card);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  border-radius: 16px; padding: 11px 12px;
  display: flex; flex-direction: column; gap: 8px;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.inv-card:hover { background: var(--glass-card-hov); border-color: rgba(255, 255, 255, 0.24); }
.inv-card.equipped {
  border-color: rgba(52, 211, 153, 0.62);
  background: linear-gradient(155deg, rgba(16, 185, 129, 0.15), rgba(15, 23, 42, 0.48));
}
.inv-card.illegal { border-color: rgba(251, 113, 133, 0.30); }

.inv-top { display: flex; align-items: flex-start; gap: 10px; }
.inv-slot {
  position: relative;
  width: 44px; height: 44px; border-radius: 13px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(56, 189, 248, 0.13);
  border: 1px solid rgba(125, 211, 252, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.inv-slot.food { background: rgba(245, 158, 11, 0.15); border-color: rgba(252, 211, 77, 0.32); }
.inv-slot.res  { background: rgba(45, 212, 191, 0.15); border-color: rgba(94, 234, 212, 0.32); }
.inv-slot.gear { background: rgba(244, 63, 94, 0.16); border-color: rgba(253, 164, 175, 0.34); }
.inv-qty {
  position: absolute; right: -4px; bottom: -4px;
  padding: 1px 5.5px; border-radius: 999px;
  background: #0f172a; border: 1px solid rgba(186, 230, 253, 0.55);
  color: #f8fafc; font-size: 10.2px; font-weight: 800; line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.inv-headings { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2.5px; }
.inv-title-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.inv-title-row b { font-size: 13.5px; color: #f8fafc; line-height: 1.2; }
.inv-tag {
  padding: 1.5px 6.5px; border-radius: 999px;
  font-size: 9.8px; font-weight: 700;
}
.inv-tag.eq { background: rgba(16, 185, 129, 0.24); border: 1px solid rgba(110, 231, 183, 0.55); color: #a7f3d0; }
.inv-tag.gh { background: rgba(244, 63, 94, 0.20); border: 1px solid rgba(253, 164, 175, 0.45); color: #fecdd3; }
.inv-sub {
  font-size: 11px; color: #94a3b8;
  display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap;
}

.inv-val {
  flex: none; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 1.5px;
  font-variant-numeric: tabular-nums;
}
.inv-val-unit {
  display: inline-flex; align-items: center; gap: 3.5px;
  font-size: 12px; font-weight: 800; color: #bae6fd; white-space: nowrap;
}
.inv-val-unit.cash { color: #fde68a; }
.inv-val-tot { font-size: 10.3px; color: #94a3b8; white-space: nowrap; }

.inv-desc { margin: 0; font-size: 11.6px; color: var(--muted); line-height: 1.35; }
.inv-specs { display: flex; flex-wrap: wrap; gap: 5px; }

.inv-foot {
  margin-top: auto; padding-top: 2px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.inv-foot .inv-main-btn { flex: 1 1 auto; }
.inv-drop-grp {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 5px;
}
.inv-drop-btn {
  min-width: 34px; padding: 0 9px !important;
  color: #cbd5e1; border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.055);
}
.inv-drop-btn:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(251, 191, 36, 0.52);
  color: #fde68a;
}

.inv-empty {
  padding: 18px 16px; border-radius: 16px; text-align: center;
  background: rgba(255, 255, 255, 0.045);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.inv-empty p { margin: 0; font-size: 12.5px; color: #94a3b8; max-width: 440px; line-height: 1.42; }
.inv-empty-btns { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-top: 2px; }

.inv-furn-sec { margin-top: 15px; padding-top: 13px; border-top: 1px solid rgba(255, 255, 255, 0.11); }
.inv-furn-sec.standalone { margin-top: 2px; padding-top: 0; border-top: none; }
.inv-furn-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(154px, 1fr)); gap: 9px;
}
@media (max-width: 480px) {
  .inv-furn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}
.inv-furn-card {
  position: relative;
  background: var(--glass-card);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  border-radius: 15px; padding: 10px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 5px;
}
.inv-furn-card img { width: 52px; height: 52px; object-fit: contain; }
.inv-furn-card b { font-size: 12.2px; line-height: 1.22; color: #f8fafc; }
.inv-furn-cnt {
  position: absolute; top: 7px; right: 7px;
  padding: 1.5px 6.5px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800;
  background: rgba(56, 189, 248, 0.22);
  border: 1px solid rgba(125, 211, 252, 0.48);
  color: #bae6fd;
}
.inv-furn-meta { font-size: 10.8px; color: #93c5fd; display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: center; }
.inv-furn-card .btn.sm { width: 100%; margin-top: auto; min-height: 31px; font-size: 11.4px; }

/* ---------- Трофеї (Досягнення) ---------- */
.ach-card {
  background: var(--glass-card);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 15px; padding: 11px 12px;
  display: flex; align-items: flex-start; gap: 10px;
  opacity: 0.78;
}
.ach-card.done {
  opacity: 1;
  border-color: rgba(52, 211, 153, 0.55);
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.15), rgba(15, 23, 42, 0.48));
  box-shadow: inset 0 1px 0 rgba(167, 243, 208, 0.18);
}
.ach-ico {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.ach-card.done .ach-ico {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(110, 231, 183, 0.52);
}
.ach-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ach-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.ach-top b { font-size: 13.2px; color: #f8fafc; }
.ach-badge {
  font-size: 10.2px; font-weight: 700; padding: 2px 7.5px; border-radius: 999px; white-space: nowrap;
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.14); color: #94a3b8;
  display: inline-flex; align-items: center; gap: 3.5px;
}
.ach-card.done .ach-badge {
  background: rgba(16, 185, 129, 0.22); border-color: rgba(110, 231, 183, 0.52); color: #a7f3d0;
}
.ach-body p { margin: 0; font-size: 11.6px; color: var(--muted); line-height: 1.36; }

/* ---------- Справжнє Фермерство (Сонячна Ферма: Інструкція Кар’єри, Насіння, 6 Полів та Власні Грядки) ---------- */
.job-card.farm-info-card {
  border-color: rgba(52, 211, 153, 0.36);
  background: linear-gradient(155deg, rgba(16, 185, 129, 0.11), rgba(15, 23, 42, 0.52));
}
.job-farm-guide {
  display: flex; flex-direction: column; gap: 5px;
  padding: 8px 10px; border-radius: 11px;
  background: rgba(8, 15, 28, 0.45);
  border: 1px solid rgba(110, 231, 183, 0.20);
}
.jfg-step {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 11.8px; line-height: 1.36; color: #cbd5e1;
}
.jfg-step svg, .jfg-step .vc-ic { flex: none; margin-top: 1px; }
.jfg-step b { color: #ecfdf5; font-weight: 700; }

.farm-sec-head {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.8px; font-weight: 700; color: #e2e8f0;
  margin: 2px 0 8px;
}
.farm-seed-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  padding: 8px 11px; margin-bottom: 10px; border-radius: 12px;
  background: rgba(16, 185, 129, 0.10);
  border: 1px solid rgba(52, 211, 153, 0.32);
}
.farm-seed-lbl {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: #d1fae5;
}
.farm-seed-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.farm-crop-card.active-seed {
  border-color: rgba(52, 211, 153, 0.58);
  box-shadow: inset 0 1px 0 rgba(167, 243, 208, 0.18);
}
.farm-price-tag {
  font-size: 12px; font-weight: 800; color: #fbbf24; white-space: nowrap;
}
.farm-btn-row {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: auto;
}
.farm-bed-head {
  display: flex; align-items: center; gap: 10px;
}
.farm-bed-thumb {
  width: 48px; height: 48px; object-fit: contain; flex: none;
  border-radius: 10px; padding: 3px;
  background: rgba(8, 14, 26, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.farm-field-card.mine {
  border-color: rgba(52, 211, 153, 0.58);
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.14), rgba(15, 23, 42, 0.50));
}
.farm-field-card.busy {
  border-color: rgba(56, 189, 248, 0.38);
}
.farm-status-pill {
  font-size: 11px; font-weight: 700; padding: 2.5px 8.5px; border-radius: 999px; white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.farm-status-pill.free {
  background: rgba(245, 158, 11, 0.18); border-color: rgba(251, 191, 36, 0.45); color: #fde68a;
}
.farm-status-pill.mine {
  background: rgba(16, 185, 129, 0.22); border-color: rgba(110, 231, 183, 0.55); color: #bbf7d0;
}
.farm-status-pill.busy {
  background: rgba(14, 165, 233, 0.18); border-color: rgba(125, 211, 252, 0.45); color: #bae6fd;
}
.farm-bed-mini-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 6px;
  margin: 6px 0 4px;
}
.fbm-cell {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 8px; border-radius: 9px; font-size: 11.4px; font-weight: 600;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.10); color: #cbd5e1;
}
.fbm-cell.ripe {
  background: rgba(16, 185, 129, 0.20); border-color: rgba(52, 211, 153, 0.52); color: #bbf7d0;
}
.fbm-cell.grow {
  background: rgba(56, 189, 248, 0.14); border-color: rgba(125, 211, 252, 0.36); color: #e0f2fe;
}

/* ---------- Інтерактив між гравцями: Запрошення, Дії над Гравцем та Живий Обмін ---------- */
.social-invites {
  position: fixed;
  top: 72px;
  right: 14px;
  z-index: 64;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(350px, calc(100vw - 24px));
  pointer-events: none;
}
.soc-invite {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 13px;
  border-radius: 16px;
  background: rgba(10, 16, 30, 0.92);
  border: 1px solid rgba(125, 211, 252, 0.38);
  box-shadow: 0 14px 32px rgba(2, 6, 23, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.soc-invite-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.6px;
  color: #f1f5f9;
}
.soc-invite-msg {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  line-height: 1.32;
}
.soc-invite-ttl {
  font-size: 10.8px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(125, 211, 252, 0.32);
  color: #bae6fd;
  white-space: nowrap;
}
.soc-invite-btns {
  display: flex;
  gap: 7px;
}
.soc-invite-btns .btn { flex: 1; justify-content: center; }

.modal-box[data-mkind="player_act"] { max-width: 490px; }
.modal-box[data-mkind="trade"] { max-width: 710px; }

.pa-hero {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.62), rgba(15, 23, 42, 0.52));
  border: 1px solid rgba(255, 255, 255, 0.13);
  margin-bottom: 12px;
}
.pa-avatar-wrap {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  flex: none;
  background: radial-gradient(circle at 50% 35%, rgba(56, 189, 248, 0.24), rgba(15, 23, 42, 0.85));
  border: 1px solid rgba(125, 211, 252, 0.36);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pa-avatar-wrap canvas { width: 100%; height: 100%; display: block; }
.pa-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pa-name-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.pa-name-row b { font-size: 16px; color: #f8fafc; }
.pa-clan {
  font-size: 10.8px; font-weight: 800; padding: 2px 7px; border-radius: 999px;
  background: rgba(129, 140, 248, 0.22); border: 1px solid rgba(165, 180, 252, 0.45); color: #e0e7ff;
}
.pa-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pa-chip {
  display: inline-flex; align-items: center; gap: 4.5px;
  font-size: 11px; font-weight: 600; padding: 2.5px 8.5px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.14); color: #cbd5e1;
}
.pa-chip.safe { background: rgba(16, 185, 129, 0.18); border-color: rgba(110, 231, 183, 0.45); color: #bbf7d0; }
.pa-chip.ghetto { background: rgba(244, 63, 94, 0.20); border-color: rgba(251, 113, 133, 0.48); color: #fecdd3; }
.pa-chip.friend { background: rgba(56, 189, 248, 0.18); border-color: rgba(125, 211, 252, 0.45); color: #bae6fd; }

.pa-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 10px;
}
.pa-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.54);
  border: 1px solid rgba(255, 255, 255, 0.11);
}
.pa-card.locked {
  opacity: 0.78;
  background: rgba(15, 23, 42, 0.38);
  border-style: dashed;
}
.pa-card.danger {
  border-color: rgba(251, 113, 133, 0.36);
  background: linear-gradient(155deg, rgba(159, 18, 57, 0.18), rgba(15, 23, 42, 0.56));
}
.pa-card-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.pa-card-top b { display: inline-flex; align-items: center; gap: 6px; font-size: 13.2px; color: #f8fafc; }
.pa-card p { margin: 0; font-size: 11.4px; line-height: 1.35; color: var(--muted); }
.pa-card .btn { width: 100%; justify-content: center; }
.pa-foot {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}
.pa-foot .btn { flex: 1; justify-content: center; }

/* Живий 2-сторонній Обмін (Trade Modal) */
.tr-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 11px;
  background: rgba(56, 189, 248, 0.11);
  border: 1px solid rgba(125, 211, 252, 0.28);
  font-size: 11.6px;
  color: #e0f2fe;
  margin-bottom: 10px;
}
.tr-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 11px;
}
.tr-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 12px;
  border-radius: 15px;
  background: rgba(15, 23, 42, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.tr-side.locked {
  border-color: rgba(52, 211, 153, 0.58);
  background: linear-gradient(155deg, rgba(16, 185, 129, 0.14), rgba(15, 23, 42, 0.56));
}
.tr-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.tr-side-head b {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.4px; color: #f8fafc;
}
.tr-lock-pill {
  font-size: 10.6px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.15); color: #cbd5e1;
  white-space: nowrap;
}
.tr-lock-pill.ok {
  background: rgba(16, 185, 129, 0.24); border-color: rgba(110, 231, 183, 0.56); color: #bbf7d0;
}
.tr-cash-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 9px;
  border-radius: 11px;
  background: rgba(8, 13, 25, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.tr-cash-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tr-cash-inp {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 23, 42, 0.85);
  color: #fde047;
  font: 700 13px Rubik, system-ui, sans-serif;
}
.tr-cash-quick { display: flex; gap: 5px; flex-wrap: wrap; }
.tr-peer-cash {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: 11px;
  background: rgba(8, 13, 25, 0.48); border: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 12.6px; color: #cbd5e1;
}
.tr-peer-cash b { color: #4ade80; font-size: 13.6px; }
.tr-items {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 76px;
}
.tr-empty {
  margin: auto 0;
  text-align: center;
  font-size: 11.5px;
  color: #64748b;
  padding: 12px 6px;
}
.tr-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 5px 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 12px;
}
.tr-item-lbl {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: #f1f5f9; font-weight: 600;
}
.tr-bag-sec {
  padding: 10px 11px;
  border-radius: 14px;
  background: rgba(8, 14, 27, 0.50);
  border: 1px solid rgba(255, 255, 255, 0.10);
  margin-bottom: 11px;
}
.tr-bag-title {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12px; font-weight: 700; color: #cbd5e1; margin-bottom: 7px;
}
.tr-bag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 6px;
}
.tr-bag-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 5px 8px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.11);
  font-size: 11.6px; color: #e2e8f0;
}
.tr-bag-chip-l { display: inline-flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-bag-chip-b { display: inline-flex; gap: 4px; flex: none; }
.tr-foot {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tr-foot .btn { flex: 1; justify-content: center; padding: 9px 14px; }

.char-friends-sec {
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.10);
}
.char-friends-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  gap: 7px;
  margin-top: 8px;
}
.char-friend-pill {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 6px 9px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.11);
  font-size: 12px;
}
.char-friend-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: #f1f5f9; min-width: 0; }

@media (max-width: 640px) {
  .pa-grid { grid-template-columns: 1fr; }
  .tr-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 8px;
  }
  .tr-side { padding: 8px; gap: 6px; border-radius: 12px; }
  .tr-side-head { flex-wrap: wrap; gap: 3px; }
  .tr-side-head b { font-size: 11.8px; }
  .tr-lock-pill { font-size: 9.8px; padding: 1.5px 6px; }
  .tr-cash-box, .tr-peer-cash { padding: 6px 7px; font-size: 11.2px; }
  .tr-cash-inp { padding: 4px 6px; font-size: 12px; }
  .tr-cash-quick .btn.sm { padding: 3px 6px; font-size: 10.4px; min-height: 28px; }
  .tr-items { max-height: 118px; overflow-y: auto; min-height: 46px; }
  .tr-item-row { padding: 4px 6px; font-size: 11px; gap: 4px; }
  .tr-sticky-wrap {
    position: sticky; top: -11px; z-index: 5;
    background: linear-gradient(180deg, rgba(13, 21, 38, 0.98) 88%, rgba(13, 21, 38, 0.85));
    padding-top: 2px; padding-bottom: 4px; margin-bottom: 4px;
  }
  .social-invites {
    top: var(--toast-top, calc(98px + env(safe-area-inset-top, 0px)));
    bottom: auto; right: 10px; left: 10px; max-width: none;
  }
}

/* ---------- Знос одягу, Ткацький верстат та Векторна Студія Модельєра ---------- */
.modal-box[data-mkind="designer"] {
  max-width: 920px;
}
.dur-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 7px;
  margin-bottom: 10px;
}
.dur-pill-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 7px 9px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.dur-pill-card.broken {
  border-color: rgba(251, 113, 133, 0.55);
  background: rgba(127, 29, 29, 0.22);
}
.dur-pill-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.4px;
}
.dur-pill-top b {
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dur-bar {
  height: 5.5px;
  border-radius: 999px;
  background: rgba(5, 10, 20, 0.62);
  overflow: hidden;
}
.dur-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981, #34d399);
}
.dur-bar.mid i { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.dur-bar.low i { background: linear-gradient(90deg, #e11d48, #fb7185); }

.garment-thumb {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: radial-gradient(circle at 50% 35%, rgba(56, 189, 248, 0.18), rgba(15, 23, 42, 0.72));
  border: 1px solid rgba(255, 255, 255, 0.16);
  object-fit: contain;
  flex: none;
}

.des-studio {
  display: grid;
  grid-template-columns: minmax(276px, 320px) minmax(0, 1fr);
  gap: 13px;
  align-items: start;
}
.des-left, .des-right {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}
.des-canvas-card {
  padding: 10px;
  border-radius: 16px;
  background: linear-gradient(155deg, rgba(30, 41, 59, 0.72), rgba(9, 14, 26, 0.82));
  border: 1px solid rgba(148, 197, 255, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.des-cv-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 13px;
  background: radial-gradient(circle at 50% 42%, rgba(56, 189, 248, 0.12), rgba(6, 10, 20, 0.75));
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px;
}
#desTemplateCv {
  width: 268px;
  height: 268px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  cursor: crosshair;
  touch-action: none;
  display: block;
}
.des-tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.des-tool-btn {
  padding: 4.5px 8.5px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font: 600 11px 'Rubik', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.des-tool-btn:hover { background: rgba(255, 255, 255, 0.13); color: #ffffff; }
.des-tool-btn.on {
  background: rgba(56, 189, 248, 0.26);
  border-color: rgba(125, 211, 252, 0.78);
  color: #ffffff;
}
.des-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.des-sw {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 2px solid rgba(255, 255, 255, 0.24);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.des-sw.dye {
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.45);
}
.des-sw.on {
  transform: scale(1.14);
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.72);
}
.des-preview-hero {
  display: grid;
  grid-template-columns: 146px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 11px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.12), rgba(15, 23, 42, 0.58));
  border: 1px solid rgba(148, 197, 255, 0.22);
}
.des-mannequin-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 6px;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 35%, rgba(56, 189, 248, 0.20), rgba(8, 13, 25, 0.58));
  border: 1px solid rgba(255, 255, 255, 0.13);
}
#desMannequinCv {
  width: 128px;
  height: 148px;
  display: block;
}
.des-cuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(134px, 1fr));
  gap: 6px;
}
.des-cut-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 6px 9px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(15, 23, 42, 0.52);
  color: #e2e8f0;
  font: 600 11.4px 'Rubik', sans-serif;
  cursor: pointer;
  text-align: left;
}
.des-cut-btn.on {
  background: rgba(56, 189, 248, 0.24);
  border-color: rgba(125, 211, 252, 0.72);
  color: #ffffff;
}
.des-inputs-row {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 8px;
}
.stu-mtabs {
  display: none; gap: 5px;
  overflow-x: auto; scrollbar-width: none;
  padding: 6px 0; margin-bottom: 8px;
}
.stu-mtabs::-webkit-scrollbar { display: none; }
.stu-mtab {
  flex: 1 0 auto; min-height: 36px; padding: 6px 10px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.065);
  color: var(--muted); font: 600 11.5px 'Rubik', sans-serif;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap;
  cursor: pointer;
}
.stu-mtab.on {
  background: rgba(56, 189, 248, 0.30); border-color: rgba(125, 211, 252, 0.80); color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
@media (max-width: 740px) {
  .stu-mtabs.des-only-mtabs { display: flex; }
  .des-studio { grid-template-columns: 1fr; gap: 9px; }
  .des-right { order: -1; }
  .des-preview-hero {
    grid-template-columns: 104px minmax(0, 1fr);
    position: sticky; top: -11px; z-index: 6;
    background: linear-gradient(155deg, rgba(16, 28, 52, 0.98), rgba(9, 15, 29, 0.99));
    box-shadow: 0 10px 24px rgba(2, 6, 18, 0.72);
    padding: 8px 9px; gap: 8px;
  }
  #desMannequinCv { width: 88px; height: 102px; }
  .des-inputs-row { grid-template-columns: 1fr; }
  .des-tool-btn { min-height: 34px; padding: 6px 10px; font-size: 11.5px; }
  .des-sw { width: 30px; height: 30px; border-radius: 9px; }
  .des-cv-wrap { padding: 10px 14px; }
  .des-studio .m-pane-hide { display: none !important; }
}

/* ---------- Етап 3: RP-служби (102 / 103 / ВіртЕкспрес), Бафи, Книга лекал та Глибокий Крафт ---------- */
.duty-hud {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  max-width: 440px;
  pointer-events: auto;
}
.duty-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(10, 16, 30, 0.90);
  border: 1px solid rgba(125, 211, 252, 0.42);
  color: #f8fafc;
  font: 600 11.5px 'Rubik', sans-serif;
  box-shadow: 0 6px 18px rgba(4, 8, 18, 0.36);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.14s ease;
}
.duty-pill:hover { transform: translateY(-1px); border-color: rgba(125, 211, 252, 0.78); }
.duty-pill.police { border-color: rgba(96, 165, 250, 0.68); background: linear-gradient(135deg, rgba(15, 32, 68, 0.92), rgba(10, 18, 36, 0.92)); }
.duty-pill.medic { border-color: rgba(52, 211, 153, 0.68); background: linear-gradient(135deg, rgba(8, 48, 40, 0.92), rgba(10, 18, 36, 0.92)); }
.duty-pill.courier { border-color: rgba(251, 146, 60, 0.72); background: linear-gradient(135deg, rgba(64, 28, 10, 0.92), rgba(14, 18, 32, 0.92)); }
.duty-pill.ready { box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.55), 0 6px 18px rgba(16, 185, 129, 0.25); }
.buff-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3.5px 8px;
  border-radius: 999px;
  background: rgba(10, 16, 30, 0.88);
  border: 1px solid rgba(250, 204, 21, 0.42);
  color: #fde68a;
  font: 600 10.8px 'Rubik', sans-serif;
}

.duty-hero {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(30, 58, 138, 0.24), rgba(15, 23, 42, 0.66));
  border: 1px solid rgba(125, 211, 252, 0.30);
  margin-bottom: 11px;
}
.duty-hero.medic {
  background: linear-gradient(145deg, rgba(6, 95, 70, 0.26), rgba(15, 23, 42, 0.66));
  border-color: rgba(52, 211, 153, 0.34);
}
.duty-hero.courier {
  background: linear-gradient(145deg, rgba(154, 52, 18, 0.28), rgba(15, 23, 42, 0.66));
  border-color: rgba(251, 146, 60, 0.38);
}
.rank-track {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.rank-step {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3.5px 9px;
  border-radius: 999px;
  font: 600 10.8px 'Rubik', sans-serif;
  background: rgba(15, 23, 42, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
}
.rank-step.done {
  color: #bae6fd;
  border-color: rgba(56, 189, 248, 0.36);
}
.rank-step.cur {
  background: rgba(56, 189, 248, 0.24);
  border-color: rgba(125, 211, 252, 0.78);
  color: #ffffff;
}
.dispatch-card {
  padding: 11px 13px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.13), rgba(15, 23, 42, 0.68));
  border: 1px solid rgba(56, 189, 248, 0.42);
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 10px;
}
.dispatch-card.hot {
  background: linear-gradient(145deg, rgba(251, 146, 60, 0.16), rgba(15, 23, 42, 0.68));
  border-color: rgba(251, 146, 60, 0.48);
}
.order-ticket {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.order-ticket.ready {
  border-color: rgba(52, 211, 153, 0.56);
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.14), rgba(15, 23, 42, 0.64));
}

.diag-opt {
  width: 100%;
  text-align: left;
  justify-content: flex-start;
  padding: 10px 13px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.66);
  border: 1px solid rgba(125, 211, 252, 0.28);
  color: #f1f5f9;
  font: 600 12.5px 'Rubik', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.1s ease;
}
.diag-opt:hover {
  background: rgba(52, 211, 153, 0.20);
  border-color: rgba(52, 211, 153, 0.68);
  transform: translateX(2px);
}

.calib-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 78px;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.calib-row input[type="range"] {
  width: 100%;
  accent-color: #38bdf8;
  cursor: pointer;
}

.tpl-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 8px;
  margin-top: 7px;
}
.tpl-card {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.60);
  border: 1px solid rgba(148, 197, 255, 0.20);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tpl-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tpl-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.master-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 8px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.52);
  color: #fde68a;
  font: 700 10.5px 'Rubik', sans-serif;
}
.pro-dur-wrap {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin-top: 3px;
}
.pro-dur-wrap > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #34d399);
}

@media (max-width: 759px) {
  .duty-hud { max-width: calc(100vw - 134px); gap: 4px; }
  .duty-pill { font-size: 10.6px; padding: 4px 8px; }
  .buff-pill { font-size: 10px; padding: 3px 6px; }
  .calib-row { grid-template-columns: 92px minmax(0, 1fr) 68px; gap: 6px; }
}

/* ---------- Авторська 2.5D-Студія Меблів, Килимів та Картин (furn_studio) ---------- */
@media (min-width: 760px) {
  .modal-box[data-mkind="furn_studio"] {
    max-width: 1120px;
    width: min(1120px, 95vw);
  }
}
.custom-furn-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: contain;
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid rgba(125, 211, 252, 0.28);
  padding: 2px;
  flex: none;
}
.fstu-layout {
  display: grid;
  grid-template-columns: 288px minmax(310px, 1fr) 340px;
  gap: 11px;
  align-items: start;
}
@media (max-width: 1060px) {
  .fstu-layout {
    grid-template-columns: 1fr 1fr;
  }
  .fstu-col-preview {
    grid-column: 1 / -1;
  }
}
@media (max-width: 759px) {
  .stu-mtabs.fstu-only-mtabs { display: flex; margin-bottom: 6px; }
  .fstu-layout {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .fstu-col-preview {
    order: -1;
    position: sticky; top: -11px; z-index: 6;
    background: rgba(11, 18, 34, 0.97);
    padding-bottom: 4px;
  }
  .fstu-col-preview .fstu-card { padding: 7px 8px; gap: 5px; }
  .fstu-room-box canvas { max-height: 152px; object-fit: contain; }
  .fstu-pill-btn { min-height: 32px; padding: 5px 9px; font-size: 11.4px; }
  .fstu-sl input[type="range"] { min-height: 28px; }
  .fstu-layout .m-pane-hide,
  .m-pane-hide.fstu-tpl-sec { display: none !important; }
}
.fstu-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.fstu-card {
  background: rgba(15, 23, 42, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fstu-lbl {
  font: 700 10.6px 'Rubik', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #93c5fd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 6px;
  min-width: 0;
}
.fstu-lbl-acts {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 100%;
}
.fstu-tex-btn {
  padding: 2.5px 7px;
  font-size: 10.2px;
  max-width: 152px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}
.fstu-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.fstu-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4.5px 8.5px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font: 600 11.2px 'Rubik', sans-serif;
  cursor: pointer;
  max-width: 100%;
  transition: background 0.13s ease, border-color 0.13s ease, color 0.13s ease;
}
.fstu-pill-btn:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #ffffff;
}
.fstu-pill-btn.on {
  background: rgba(56, 189, 248, 0.28);
  border-color: rgba(125, 211, 252, 0.78);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.fstu-inps {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 6px;
}
.fstu-inps .inp {
  margin: 0;
  padding: 6px 8px;
  font-size: 12px;
  min-width: 0;
  width: 100%;
}
.fstu-blocks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 168px;
  overflow-y: auto;
  padding-right: 2px;
}
.fstu-blk-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 9px;
  background: rgba(8, 13, 25, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.10);
  font: 600 11.4px 'Rubik', sans-serif;
  color: #e2e8f0;
  cursor: pointer;
}
.fstu-blk-row.on {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(125, 211, 252, 0.76);
  color: #ffffff;
}
.fstu-blk-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.55);
  flex: none;
}
.fstu-cad-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  gap: 7px;
  align-items: start;
}
.fstu-cv-box {
  background: #07101f;
  border: 1px solid rgba(125, 211, 252, 0.26);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.fstu-cv-box canvas {
  width: 100%;
  height: auto;
  display: block;
  touch-action: none;
  user-select: none;
}
.fstu-cv-cap {
  font-size: 10.3px;
  color: #94a3b8;
  padding: 4px 7px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 13, 25, 0.72);
}
.fstu-sliders {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
@media (max-width: 520px) {
  .fstu-sliders { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.fstu-sl {
  background: rgba(8, 13, 25, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fstu-sl label {
  display: flex;
  justify-content: space-between;
  font-size: 10.3px;
  color: #94a3b8;
}
.fstu-sl label b { color: #f1f5f9; }
.fstu-sl input[type="range"] {
  width: 100%;
  accent-color: #38bdf8;
  margin: 0;
  cursor: pointer;
}
.fstu-swatches {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
}
.fstu-sw {
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s ease, border-color 0.1s ease;
}
.fstu-sw:hover { transform: scale(1.08); }
.fstu-sw.on {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px #38bdf8;
  transform: scale(1.08);
}
.fstu-room-box {
  position: relative;
  border-radius: 13px;
  overflow: hidden;
  border: 1px solid rgba(125, 211, 252, 0.30);
  background: #070d19;
}
.fstu-room-box canvas {
  width: 100%;
  height: auto;
  display: block;
}
.fstu-room-hud {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 7px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
}
.fstu-room-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 8px;
  border-radius: 999px;
  background: rgba(8, 13, 25, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font: 600 10.5px 'Rubik', sans-serif;
  color: #e2e8f0;
}
.fstu-craft-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
@media (max-width: 520px) {
  .fstu-inps { grid-template-columns: 1fr; }
  .fstu-cad-wrap { grid-template-columns: minmax(0, 1fr) 62px; gap: 5px; }
  .fstu-swatches { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
  .fstu-sw { height: 32px; }
  .fstu-room-hud { flex-wrap: wrap; gap: 4px; }
  .fstu-room-chip { font-size: 10px; padding: 2px 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tpl-gallery { grid-template-columns: 1fr; }
  .tpl-actions .btn.sm { flex: 1 1 auto; padding: 5px 8px; font-size: 11px; }
  .fstu-lbl-acts { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .fstu-tex-btn { display: block; width: 100%; max-width: none; text-align: center; }
}
@media (max-width: 440px) {
  .fstu-craft-btns { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Оновлення 13.11.2026: прописка друзів, лічильник онлайну на мінімапі
   ========================================================================== */
#miniWrap { position: relative; }
.mm-online {
  position: absolute; left: 9px; top: 9px; z-index: 2;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px 2px 6px; border-radius: 999px;
  background: rgba(6, 12, 24, 0.78);
  border: 1px solid rgba(110, 231, 183, 0.5);
  color: #d1fae5; font-size: 10.5px; font-weight: 800; line-height: 1.25;
  pointer-events: none;
}
.mm-online-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #34d399;
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.9);
}
.mm-online.solo { border-color: rgba(148, 163, 184, 0.45); color: #cbd5e1; }
.mm-online.solo .mm-online-dot { background: #94a3b8; box-shadow: none; }

.res-card .g-card-top b { display: inline-flex; align-items: center; gap: 6px; }
.res-hint { color: var(--muted); font-size: 12px; line-height: 1.4; margin: 4px 0 8px; }
.res-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.res-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 5px 5px 10px; border-radius: 999px;
  background: rgba(16, 185, 129, 0.14); border: 1px solid rgba(110, 231, 183, 0.42);
  color: #d1fae5; font-size: 12.5px;
}
.res-chip button {
  width: 26px; height: 26px; border-radius: 50%; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(8, 13, 25, 0.5); border: 1px solid rgba(255, 255, 255, 0.16); color: #fecdd3; cursor: pointer;
}
.res-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.res-add small, .res-empty { color: var(--muted); font-size: 12px; }
.res-add small { flex-basis: 100%; }
.res-friends { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }

/* ---------- Мапа: переглядач із наближенням, фільтри місць (13.11.2026) ---------- */
.map-view {
  position: relative; overflow: hidden;
  height: min(56vh, 540px);
  border-radius: 14px; border: 1px solid var(--line);
  background: #0b1120; margin-bottom: 8px;
  touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
}
.map-view.drag { cursor: grabbing; }
.map-view canvas {
  position: absolute; left: 0; top: 0;
  transform-origin: 0 0; will-change: transform;
  image-rendering: auto;
}
.map-ctl {
  position: absolute; right: 8px; top: 8px; z-index: 2;
  display: flex; flex-direction: column; gap: 6px;
}
.map-ctl .util-btn { width: 38px; height: 38px; background: rgba(8, 13, 25, 0.82); }
.map-minus { width: 13px; height: 2.4px; border-radius: 2px; background: currentColor; display: block; }
.map-hint {
  position: absolute; left: 8px; bottom: 8px; right: 8px; z-index: 2;
  width: fit-content; max-width: calc(100% - 16px);
  padding: 4px 10px; border-radius: 999px;
  background: rgba(8, 13, 25, 0.78); border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1; font-size: 11px; font-weight: 600; pointer-events: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.map-quest {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 12px; margin-bottom: 8px; border-radius: 13px;
  background: rgba(251, 191, 36, 0.12); border: 1px solid #fbbf24;
  color: var(--txt); font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.map-quest span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-quest small { color: #fde68a; font-weight: 800; flex: none; }
.map-legend {
  display: flex; flex-wrap: wrap; gap: 5px 12px; align-items: center;
  font-size: 11.5px; color: #cbd5e1; margin-bottom: 9px;
}
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.map-legend i { width: 9px; height: 9px; display: inline-block; flex: none; }
.map-legend .lg-me { border-radius: 50%; background: #22d3ee; border: 1.5px solid #fff; }
.map-legend .lg-mine { border-radius: 2px; background: #34d399; }
.map-legend .lg-biz { border-radius: 2px; background: #60a5fa; }
.map-legend .lg-free { border-radius: 2px; border: 1.5px dashed #cbd5e1; }
.map-legend .lg-contra { width: 8px; height: 8px; background: #fbbf24; transform: rotate(45deg); }
.map-cats {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 8px; padding-bottom: 1px;
}
.map-cats::-webkit-scrollbar { display: none; }
.map-cat {
  flex: none; padding: 7px 13px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
  color: var(--txt); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.map-cat.on { background: rgba(56, 189, 248, 0.2); border-color: rgba(125, 211, 252, 0.7); color: #e0f2fe; }
.map-spots { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 6px; }
.map-spot {
  display: flex; align-items: center; gap: 7px; min-height: 42px;
  padding: 7px 9px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.045); border: 1px solid rgba(52, 211, 153, 0.35);
  color: var(--txt); font: inherit; font-size: 12.5px; font-weight: 600; text-align: left; line-height: 1.2; cursor: pointer;
}
.map-spot.risk { border-color: rgba(251, 113, 133, 0.42); }
.map-spot:active { transform: scale(0.98); }
.map-spot .ms-ic { flex: none; display: inline-flex; }
.map-spot .ms-nm { flex: 1; min-width: 0; }
.map-spot small { flex: none; color: var(--muted); font-size: 10.5px; font-weight: 700; }
.map-spot.hidden { display: none; }
.map-focus-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; margin-bottom: 8px; border-radius: 12px;
  background: rgba(56, 189, 248, 0.14); border: 1px solid rgba(125, 211, 252, 0.55);
}
.map-focus-info { display: flex; flex-direction: column; min-width: 0; flex: 1 1 160px; }
.map-focus-info b { font-size: 13px; color: #f8fafc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-focus-info small { font-size: 11px; color: #bae6fd; }
.map-spot.sel { border-color: #38bdf8; background: rgba(56, 189, 248, 0.18); box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35); }
@media (max-width: 759px) {
  .map-view { height: min(44dvh, 390px); }
  .map-spots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-spot { font-size: 12px; padding: 7px 8px; gap: 6px; }
  .modal-box[data-mkind="map"] #modalWallet { display: none; }
}
@media (max-width: 440px) {
  .map-cats { gap: 4px; max-width: 100%; }
  .map-cat { padding: 6px 9.5px; font-size: 11.6px; }
  .map-spots { grid-template-columns: 1fr; }
}
.map-plus { position: relative; width: 13px; height: 13px; display: block; }
.map-plus::before, .map-plus::after { content: ''; position: absolute; left: 0; top: 5.3px; width: 13px; height: 2.4px; border-radius: 2px; background: currentColor; }
.map-plus::after { transform: rotate(90deg); }

/* ---------- Телефони: дрібна полірування інтерфейсу (13.11.2026) ---------- */
/* чат стоїть рівно над стосом контекстних кнопок (висоту рахує updateHud → --ctx-h) */
body.phone.has-ctx #chatBox { bottom: calc(76px + var(--ctx-h, 44px) + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 759px) {
  .modal-box[data-mkind="char"] #modalWallet,
  .modal-box[data-mkind="designer"] #modalWallet,
  .modal-box[data-mkind="help"] #modalWallet,
  .modal-box[data-mkind="pet_ctrl"] #modalWallet,
  .modal-box[data-mkind="loot_bag"] #modalWallet { display: none; }
  /* довгі заголовки вікон переносяться на другий рядок замість «Оселі, Ділянки т…» */
  .m-head h2 span {
    white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    line-height: 1.16; overflow: hidden;
  }
  .m-head h2 > i, .m-head h2 > svg { flex: none; }
  /* редактор персонажа: кнопка «Оселитися» завжди на виду, без прокрутки до низу */
  .modal-box[data-mkind="creator"] .cr-start-btn {
    position: sticky; bottom: 0; z-index: 3; margin-top: 12px;
    box-shadow: 0 -12px 16px 4px rgba(10, 16, 30, 0.94), 0 10px 0 6px rgba(10, 16, 30, 0.94);
  }
  /* зручніші цілі для пальця у вкладках вікон */
  .m-tabs .m-tab { min-height: 36px; }
  /* плавний свайп закриття bottom sheet */
  .m-sheet-handle { cursor: grab; padding: 8px 36px; margin: 2px auto 0; background-clip: content-box; width: 110px; height: 20px; }
}
@media (max-width: 759px) {
  .modal-box[data-mkind="creator"] .cr-start-btn { background: linear-gradient(180deg, #2f9ff2, #1677cf) !important; }
}

/* Риболовля на мапі (14.11.2026) */
.map-legend .lg-fish { border-radius: 50%; background: #0ea5e9; border: 1.5px solid #f8fafc; }

/* ---------- 14.11.2026: режим «Вибрати», продаж зі складу, переказ між картками ---------- */
.sel-hint { display: flex; align-items: center; gap: 9px; padding: 8px 10px; font-size: 12.5px; color: #cbd5e1; line-height: 1.35; }
.sel-hint b { color: #f8fafc; }
.sel-panel { display: flex; align-items: center; gap: 10px; padding: 4px 6px; flex-wrap: wrap; width: 100%; min-width: 0; }
.sel-item { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1 1 180px; }
.sel-item > div { min-width: 0; }
.sel-item img { width: 44px; height: 44px; border-radius: 10px; background: rgba(255,255,255,.06); flex: none; object-fit: contain; }
.sel-item b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-item small { display: block; color: #94a3b8; font-size: 11.5px; line-height: 1.25; }
.sel-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.sel-acts .btn { min-height: 36px; }
@media (max-width: 520px) {
  .sel-panel { gap: 6px; padding: 2px; }
  .sel-item img { width: 38px; height: 38px; }
  .sel-acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; width: 100%; }
  .sel-acts .btn { width: 100%; min-height: 34px; font-size: 11.5px; padding: 4px 8px; }
}
.plot-kind-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
@media (max-width: 345px) {
  .plot-kind-grid { grid-template-columns: 1fr; }
}
.stock-chip { border-radius: 12px; padding: 4px 8px; gap: 6px; flex-wrap: wrap; max-width: 100%; }
.stock-chip-lbl { min-width: 0; overflow-wrap: anywhere; }
.ml-auto-desk { margin-left: auto; }
.j-pill, .jb-pill, .modal-box .m-chip, .farm-status-pill {
  max-width: 100%; white-space: normal; line-height: 1.24; box-sizing: border-box;
}
@media (max-width: 560px) {
  .ml-auto-desk { margin-left: 0; }
}
.bb-item.bb-sell { border-color: rgba(52, 211, 153, 0.55); }
.bb-item.bb-sell .bb-thumb-wrap { display: flex; align-items: center; justify-content: center; color: #86efac; }
.bb-item.bb-sell.armed { border-color: #fb7185; background: rgba(244, 63, 94, 0.16); }
.xfer-card { margin-bottom: 12px; }
.xfer-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.xfer-row select, .xfer-row input[type=number] { flex: 1 1 130px; min-width: 0; }
.xfer-quick { display: flex; gap: 5px; flex-wrap: wrap; margin: 6px 0 2px; }
.xfer-log { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; font-size: 12px; }
.xfer-log .in { color: #86efac; }
.xfer-log .out { color: #fda4af; }
.bb-tab.bb-sel-tab { border-color: rgba(253, 224, 71, 0.5); }
.bb-tab.bb-sel-tab.on { background: rgba(253, 224, 71, 0.2); border-color: #fde047; color: #fef9c3; }

/* ---------- Улюбленці та Розплідник (16.11.2026) ---------- */
.pet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: 10px; max-width: 100%; }
.pet-card, .pet-pick-card, .pet-hero-card { box-sizing: border-box; max-width: 100%; min-width: 0; }
.pet-pick-card { text-align: left; cursor: pointer; width: 100%; font: inherit; color: inherit; transition: border-color .15s, background .15s, transform .12s; }
.pet-pick-card:hover { border-color: rgba(56, 189, 248, 0.55); background: rgba(30, 41, 59, 0.85); }
.pet-pick-card.sel { border-color: #38bdf8; background: rgba(56, 189, 248, 0.14); box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35); }
.pet-card-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pet-hero-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-width: 0; }
.pet-hero-info { flex: 1 1 200px; min-width: 0; }
.pet-port-cv { flex: none; width: 84px; height: 68px; border-radius: 12px; background: radial-gradient(circle at 50% 62%, rgba(56, 189, 248, 0.16), rgba(15, 23, 42, 0.72)); border: 1px solid rgba(148, 163, 184, 0.25); }
.pet-port-cv.lg { width: 128px; height: 104px; border-radius: 14px; }
.pet-card-meta { flex: 1 1 0; min-width: 0; }
.pet-name-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.pet-name-row b { overflow-wrap: anywhere; }
.pet-collar-dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.85); flex: none; }
.pet-kind-tag { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: rgba(148, 163, 184, 0.18); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.25); white-space: nowrap; }
.pet-breed-sub { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.pet-mode-pill { display: inline-flex; align-items: center; gap: 4px; margin-top: 5px; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: rgba(56, 189, 248, 0.16); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.35); max-width: 100%; }
.pet-mode-pill.m-sit { background: rgba(251, 191, 36, 0.14); color: #fde68a; border-color: rgba(251, 191, 36, 0.35); }
.pet-mode-pill.m-home { background: rgba(52, 211, 153, 0.14); color: #86efac; border-color: rgba(52, 211, 153, 0.35); }
.pet-mode-pill.m-plot { background: rgba(168, 85, 247, 0.16); color: #d8b4fe; border-color: rgba(168, 85, 247, 0.35); }
.pet-actions-grid { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.pet-footer-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; padding-top: 7px; border-top: 1px solid rgba(148, 163, 184, 0.16); }
.collar-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.collar-sw { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); cursor: pointer; padding: 0; transition: transform .12s, border-color .12s; }
.collar-sw.on { border-color: #ffffff; transform: scale(1.16); box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.75); }
.jb-pill.full { border-color: rgba(251, 113, 133, 0.45); color: #fda4af; background: rgba(244, 63, 94, 0.14); }
@media (max-width: 560px) {
  .pet-grid { grid-template-columns: 1fr; }
  .pet-hero-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .pet-port-cv.lg { align-self: center; }
  .pet-actions-grid .btn, .pet-footer-row .btn { flex: 1 1 auto; justify-content: center; }
}

/* ---------- Рибальські контракти, Колекція риб та Злам сейфа (23.11.2026) ---------- */
.fish-ct-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(224px, 1fr));
  gap: 9px;
  margin-top: 8px;
}
.fish-ct-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 11px 12px;
  border-radius: 14px;
  background: rgba(13, 21, 38, 0.84);
  border: 1px solid rgba(125, 211, 252, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  min-width: 0;
  box-sizing: border-box;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.fish-ct-card.ready {
  border-color: rgba(52, 211, 153, 0.68);
  background: linear-gradient(150deg, rgba(16, 185, 129, 0.16), rgba(11, 18, 34, 0.90));
  box-shadow: inset 0 1px 0 rgba(167, 243, 208, 0.22), 0 0 0 1px rgba(52, 211, 153, 0.22);
}
.fish-ct-card.t2 { border-color: rgba(56, 189, 248, 0.38); }
.fish-ct-card.t3 { border-color: rgba(251, 191, 36, 0.44); }
.fish-ct-card.ready.t2,
.fish-ct-card.ready.t3 { border-color: rgba(52, 211, 153, 0.72); }
.fish-ct-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 7px;
  min-width: 0;
}
.fish-ct-head b {
  font-size: 13px;
  line-height: 1.24;
  color: #f8fafc;
  overflow-wrap: anywhere;
}
.fish-ct-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 8px;
  font-size: 11.8px;
  color: var(--muted);
  line-height: 1.3;
}
.fish-ct-prog {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 6px 9px;
  border-radius: 10px;
  background: rgba(8, 13, 25, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
}
.fish-ct-prog .xp-bar {
  width: 100%;
}
.fish-ct-card.ready .fish-ct-prog {
  color: #a7f3d0;
  border-color: rgba(52, 211, 153, 0.35);
}
.fish-ct-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 2px;
}
.fish-ct-acts .btn {
  flex: 1 1 auto;
  justify-content: center;
  min-height: 34px;
}

.fish-dex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.fish-dex-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(13, 21, 38, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.22);
  min-width: 0;
  box-sizing: border-box;
}
.fish-dex-card.caught {
  border-color: rgba(56, 189, 248, 0.46);
  background: linear-gradient(155deg, rgba(14, 165, 233, 0.13), rgba(11, 18, 34, 0.88));
}
.fish-dex-card.locked,
.fish-dex-card.miss {
  opacity: 0.64;
  border-style: dashed;
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(9, 14, 26, 0.64);
}
.fish-dex-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}
.fish-dex-top b {
  font-size: 12.2px;
  line-height: 1.24;
  color: #f8fafc;
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: break-word;
}
.fish-dex-top b > i,
.fish-dex-top b > svg {
  flex: none;
}
.fish-dex-top b:last-child:not(:first-child) {
  flex: none;
  white-space: nowrap;
}
.fish-dex-cnt {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.fish-dex-sub {
  font-size: 11px;
  color: var(--subtle);
  line-height: 1.26;
  overflow-wrap: anywhere;
}

.safe-opts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 9px;
}
.safe-opt-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 11px 12px;
  border-radius: 14px;
  background: rgba(13, 21, 38, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  min-width: 0;
  box-sizing: border-box;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.14s ease;
}
.safe-opt-card.avail,
.safe-opt-card.ready {
  border-color: rgba(125, 211, 252, 0.44);
}
.safe-opt-card.silent {
  border-color: rgba(52, 211, 153, 0.52);
  background: linear-gradient(155deg, rgba(16, 185, 129, 0.14), rgba(11, 18, 34, 0.90));
}
.safe-opt-card.risk {
  border-color: rgba(251, 146, 60, 0.44);
}
.safe-opt-card.disabled,
.safe-opt-card.locked {
  opacity: 0.62;
  border-color: rgba(148, 163, 184, 0.18);
}
.safe-opt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}
.safe-opt-head b {
  font-size: 13px;
  color: #f8fafc;
  line-height: 1.22;
}
.safe-opt-desc {
  font-size: 11.8px;
  color: var(--muted);
  line-height: 1.36;
}
.safe-opt-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.safe-opt-foot {
  margin-top: auto;
  padding-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.safe-opt-foot .btn,
.safe-opt-card > .btn {
  width: 100%;
  justify-content: center;
  min-height: 36px;
}

@media (max-width: 720px) {
  .safe-opts { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 560px) {
  .fish-ct-grid { grid-template-columns: 1fr; gap: 8px; }
  .fish-dex-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .fish-ct-card, .safe-opt-card { padding: 10px; }
  .fish-dex-card { padding: 7px 8px; }
}
@media (max-width: 345px) {
  .fish-dex-grid { grid-template-columns: 1fr; }
}

/* ---------- Живі мешканці, стосунки, AI-діалоги, контакти та Побачення (#dateHud, .npc-*) ---------- */
.date-hud {
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 16px;
  max-width: 420px;
  background: linear-gradient(145deg, rgba(64, 18, 46, 0.90) 0%, rgba(15, 21, 40, 0.94) 100%);
  border: 1px solid rgba(244, 114, 182, 0.52);
  box-shadow: var(--spec-rim), 0 10px 24px rgba(4, 9, 22, 0.44);
  pointer-events: auto;
}
.date-hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.date-hud-who {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #fce7f3;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.date-hud-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.date-tier-badge {
  padding: 1.5px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.10);
  color: #f8fafc;
}
.date-tier-badge.bronze { border-color: rgba(251, 146, 60, 0.65); background: rgba(154, 52, 18, 0.42); color: #fed7aa; }
.date-tier-badge.silver { border-color: rgba(203, 213, 225, 0.68); background: rgba(71, 85, 105, 0.50); color: #f1f5f9; }
.date-tier-badge.gold { border-color: rgba(251, 191, 36, 0.78); background: rgba(161, 98, 7, 0.46); color: #fef08a; }
.date-hud-timer {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #fbcfe8;
}
.date-hud-bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(5, 10, 20, 0.56);
  overflow: hidden;
}
.date-hud-bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f472b6, #fbbf24);
  transition: width 0.25s ease;
}
.date-hud-goals {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.date-goal-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--muted);
}
.date-goal-pill.done {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(52, 211, 153, 0.65);
  color: #d1fae5;
}
.date-hud-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.date-hud-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8.5px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
  font: 600 10.8px 'Rubik', sans-serif;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.12s ease;
}
.date-hud-btn:hover { background: rgba(255, 255, 255, 0.18); border-color: rgba(244, 114, 182, 0.72); }
.date-hud-btn:active { transform: scale(0.96); }
.date-hud-btn.pri { background: rgba(236, 72, 153, 0.34); border-color: rgba(244, 114, 182, 0.72); }
.date-hud-btn.end { background: rgba(244, 63, 94, 0.24); border-color: rgba(251, 113, 133, 0.52); color: #ffe4e6; }

/* Стрічка діалогу з продавцем у магазинах та установах */
.npc-clerk-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 8px 11px;
  margin-bottom: 11px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.14), rgba(15, 23, 42, 0.72));
  border: 1px solid rgba(125, 211, 252, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.npc-clerk-info {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1 1 200px;
}
.npc-clerk-av {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(125, 211, 252, 0.42);
  flex: none;
  display: block;
}
.npc-clerk-txt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.npc-clerk-txt b {
  font-size: 12.8px;
  color: #f8fafc;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.npc-clerk-txt small {
  font-size: 11px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.npc-perk-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7.5px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--muted);
}
.npc-perk-pill.on {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(52, 211, 153, 0.66);
  color: #a7f3d0;
}

/* Діалогове вікно з жителем / продавцем (.npc-dlg) */
.npc-dlg {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.npc-dlg > div:empty {
  display: none;
}
.npc-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 16px;
  background: linear-gradient(150deg, rgba(30, 41, 72, 0.52), rgba(11, 18, 34, 0.78));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.npc-portrait-wrap {
  position: relative;
  flex: none;
  width: 78px;
  height: 78px;
  border-radius: 18px;
  background: radial-gradient(circle at 50% 35%, rgba(56, 189, 248, 0.24), rgba(11, 18, 34, 0.86));
  border: 1.5px solid rgba(125, 211, 252, 0.52);
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.34);
}
.npc-portrait-wrap.romantic {
  border-color: rgba(244, 114, 182, 0.78);
  background: radial-gradient(circle at 50% 35%, rgba(244, 114, 182, 0.26), rgba(20, 12, 32, 0.88));
}
.npc-portrait-wrap.angry {
  border-color: rgba(251, 113, 133, 0.78);
}
.npc-portrait-cv {
  width: 100%;
  height: 100%;
  display: block;
}
.npc-head-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.npc-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.npc-name-row h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}
.npc-role-lbl {
  font-size: 12px;
  font-weight: 600;
  color: #93c5fd;
}
.npc-bday-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.28), rgba(244, 114, 182, 0.28));
  border: 1px solid rgba(251, 191, 36, 0.72);
  color: #fef08a;
}
.npc-bio {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.38;
}
.npc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4.5px;
  align-items: center;
}
.npc-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 8px;
  border-radius: 999px;
  font-size: 10.8px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
}
.npc-chip.act {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(125, 211, 252, 0.42);
  color: #bae6fd;
}
.npc-chip.date {
  background: rgba(244, 114, 182, 0.22);
  border-color: rgba(244, 114, 182, 0.62);
  color: #fbcfe8;
}
.npc-needs-mini {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  margin-top: 2px;
}
.npc-need-m {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 5px;
  border-radius: 8px;
  background: rgba(8, 13, 25, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.10);
}
.npc-need-m.low { border-color: rgba(251, 113, 133, 0.58); }
.npc-need-m .xp-bar { flex: 1; height: 5px; min-width: 18px; }

/* Картка стосунків (.npc-bars) */
.npc-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 15px;
  background: var(--glass-card);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.npc-bars-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.npc-bars-grid.single {
  grid-template-columns: 1fr;
}
.npc-bar-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.npc-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.8px;
}
.npc-bar-top b {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}
.npc-rank-pill {
  padding: 1.5px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.62);
}
.npc-bar-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(5, 10, 20, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.npc-bar-track > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}
.npc-bar-mid {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.35);
}
.npc-rel-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.npc-partner-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.34), rgba(244, 63, 94, 0.28));
  border: 1px solid rgba(244, 114, 182, 0.78);
  color: #fce7f3;
}
.npc-warn-banner {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 11px;
  background: rgba(159, 18, 57, 0.26);
  border: 1px solid rgba(251, 113, 133, 0.54);
  color: #fecdd3;
  font-size: 11.8px;
  line-height: 1.32;
}
.npc-far-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 12px;
  background: rgba(14, 116, 144, 0.22);
  border: 1px solid rgba(56, 189, 248, 0.44);
  color: #e0f2fe;
  font-size: 12px;
}

/* Щоденне прохання NPC */
.npc-req-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 9px 12px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(251, 191, 36, 0.14), rgba(15, 23, 42, 0.68));
  border: 1px solid rgba(251, 191, 36, 0.42);
}
.npc-req-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 200px;
}
.npc-req-info b {
  font-size: 12.6px;
  color: #fef3c7;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.npc-req-info small {
  font-size: 11.4px;
  color: var(--muted);
}

/* Чат-лог з AI (.npc-chat-log & .npc-msg) */
.npc-chat-log {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 124px;
  max-height: 230px;
  overflow-y: auto;
  padding: 10px 11px;
  border-radius: 15px;
  background: rgba(7, 12, 24, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.12);
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.42) rgba(255, 255, 255, 0.05);
}
.npc-chat-log::-webkit-scrollbar { width: 6px; }
.npc-chat-log::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.npc-chat-log::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.04); border-radius: 999px; margin: 6px 0; }
.npc-chat-log::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.40), rgba(125, 211, 252, 0.46));
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.npc-msg {
  max-width: 86%;
  padding: 8px 11px;
  border-radius: 14px;
  font-size: 12.8px;
  line-height: 1.4;
  word-break: break-word;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.npc-msg.npc {
  align-self: flex-start;
  background: rgba(30, 41, 59, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-bottom-left-radius: 5px;
  color: #f8fafc;
}
.npc-msg.me {
  align-self: flex-end;
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.34), rgba(2, 132, 199, 0.44));
  border: 1px solid rgba(125, 211, 252, 0.48);
  border-bottom-right-radius: 5px;
  color: #f0f9ff;
}
.npc-msg.sys {
  align-self: center;
  max-width: 96%;
  padding: 4.5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  font-size: 11.2px;
  text-align: center;
}
.npc-msg-who {
  font-size: 10.2px;
  font-weight: 700;
  color: #93c5fd;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.npc-deltas {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.npc-delta-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1.5px 7px;
  border-radius: 999px;
  font-size: 10.3px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.20);
  border: 1px solid rgba(52, 211, 153, 0.52);
  color: #a7f3d0;
}
.npc-delta-pill.neg {
  background: rgba(244, 63, 94, 0.20);
  border-color: rgba(251, 113, 133, 0.54);
  color: #fecdd3;
}
.npc-delta-pill.rom {
  background: rgba(236, 72, 153, 0.22);
  border-color: rgba(244, 114, 182, 0.56);
  color: #fbcfe8;
}
.npc-delta-pill.fact {
  background: rgba(251, 191, 36, 0.20);
  border-color: rgba(251, 191, 36, 0.55);
  color: #fef08a;
}
.npc-typing {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.66);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: var(--muted);
  font-size: 11.8px;
}
.npc-dots {
  display: inline-flex;
  gap: 3px;
}
.npc-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #7dd3fc;
  animation: npcDotPulse 1s infinite ease-in-out;
}
.npc-dots i:nth-child(2) { animation-delay: 0.16s; }
.npc-dots i:nth-child(3) { animation-delay: 0.32s; }
@keyframes npcDotPulse {
  0%, 80%, 100% { opacity: 0.28; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.1); }
}

/* Швидкі дії та лоток подарунків (.npc-actions, .npc-gift-tray) */
.npc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5.5px;
}
.npc-actions .btn.sm {
  min-height: 32px;
  padding: 4px 9.5px;
  font-size: 11.6px;
}
.npc-actions .btn.rom {
  background: rgba(236, 72, 153, 0.24);
  border-color: rgba(244, 114, 182, 0.55);
  color: #fce7f3;
}
.npc-actions .btn.rom:hover {
  background: rgba(236, 72, 153, 0.36);
}
.npc-actions .btn:disabled,
.npc-form button:disabled,
.npc-form input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.npc-gift-tray {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 9px 10px;
  border-radius: 14px;
  background: rgba(10, 17, 32, 0.78);
  border: 1px solid rgba(251, 191, 36, 0.38);
}
.npc-gift-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #fde68a;
}
.npc-gift-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
  max-height: 168px;
  overflow-y: auto;
}
.npc-gift-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  font: 600 11.5px 'Rubik', sans-serif;
  cursor: pointer;
  text-align: left;
  min-width: 0;
  transition: background 0.14s ease, border-color 0.14s ease;
}
.npc-gift-item:hover {
  background: rgba(251, 191, 36, 0.16);
  border-color: rgba(251, 191, 36, 0.56);
}
.npc-gift-item.loved {
  border-color: rgba(244, 114, 182, 0.62);
  background: rgba(236, 72, 153, 0.14);
}
.npc-gift-item.disliked {
  border-color: rgba(251, 113, 133, 0.52);
  background: rgba(159, 18, 57, 0.16);
}
.npc-gift-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}
.npc-gift-name > svg,
.npc-gift-name > i {
  flex: none;
}
.npc-gift-name > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.npc-gift-tag {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding-left: 4px;
  font-size: 10.5px;
  color: var(--muted);
}

/* Форма вільного чату (.npc-form) */
.npc-form {
  display: flex;
  gap: 7px;
  align-items: center;
}
.npc-form .inp {
  flex: 1;
  height: 40px;
  font-size: 13px;
}
.npc-form .btn {
  flex: none;
  min-height: 40px;
  padding: 0 14px;
}
.npc-form input[readonly] {
  opacity: 0.72;
}

/* Довідник «Знайомі та жителі міста» (.npc-contacts, .npc-card) */
.npc-contacts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.npc-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.npc-filter-btn {
  padding: 5px 10.5px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font: 600 11.5px 'Rubik', sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.npc-filter-btn:hover { background: rgba(255, 255, 255, 0.12); color: #ffffff; }
.npc-filter-btn.on {
  background: rgba(56, 189, 248, 0.28);
  border-color: rgba(125, 211, 252, 0.72);
  color: #ffffff;
}
.npc-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 10px;
}
.npc-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 12px;
  border-radius: 16px;
  background: var(--glass-card);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  min-width: 0;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.npc-card:hover {
  background: var(--glass-card-hov);
  border-color: rgba(255, 255, 255, 0.24);
}
.npc-card.partner {
  border-color: rgba(244, 114, 182, 0.56);
  background: linear-gradient(155deg, rgba(236, 72, 153, 0.10), rgba(15, 23, 42, 0.62));
}
.npc-card.bday {
  border-color: rgba(251, 191, 36, 0.56);
}
.npc-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.npc-card-av {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  flex: none;
  background: radial-gradient(circle at 50% 35%, rgba(56, 189, 248, 0.22), rgba(11, 18, 34, 0.86));
  border: 1.5px solid rgba(125, 211, 252, 0.44);
  display: block;
}
.npc-card.partner .npc-card-av { border-color: rgba(244, 114, 182, 0.74); }
.npc-card-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.npc-card-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}
.npc-card-name b {
  font-size: 14px;
  color: #ffffff;
}
.npc-card-sub {
  font-size: 11.4px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.npc-milestones {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.npc-ms-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1.5px 6.5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--subtle);
}
.npc-ms-pill.done {
  background: rgba(251, 191, 36, 0.18);
  border-color: rgba(251, 191, 36, 0.56);
  color: #fde68a;
}
.npc-taste-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.npc-taste-chip {
  display: inline-flex;
  align-items: center;
  gap: 3.5px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  background: rgba(236, 72, 153, 0.14);
  border: 1px solid rgba(244, 114, 182, 0.42);
  color: #fbcfe8;
}
.npc-taste-chip.bad {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(251, 113, 133, 0.42);
  color: #fecdd3;
}
.npc-facts-details {
  border-radius: 10px;
  background: rgba(8, 13, 25, 0.50);
  border: 1px solid rgba(255, 255, 255, 0.10);
  padding: 5px 8px;
  font-size: 11.4px;
}
.npc-facts-details summary {
  cursor: pointer;
  color: #bae6fd;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 5px;
}
.npc-facts-details summary::-webkit-details-marker { display: none; }
.npc-facts-list {
  margin: 5px 0 0;
  padding: 0 0 0 15px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.npc-card-foot {
  margin-top: auto;
  display: flex;
  gap: 6px;
  padding-top: 2px;
}
.npc-card-foot .btn.sm {
  flex: 1 1 0;
  min-height: 34px;
}

@media (min-width: 760px) {
  .modal-box[data-mkind="npc_talk"] {
    max-width: 800px;
    height: min(710px, 88vh);
    max-height: 88vh;
  }
  .modal-box[data-mkind="npc_talk"] .m-body {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 14px 12px;
  }
  .modal-box[data-mkind="npc_talk"] .npc-dlg {
    flex: 1 1 auto;
    min-height: 0;
    gap: 7px;
  }
  .modal-box[data-mkind="npc_talk"] #npcHeadSlot,
  .modal-box[data-mkind="npc_talk"] #npcBarsSlot,
  .modal-box[data-mkind="npc_talk"] #npcReqSlot,
  .modal-box[data-mkind="npc_talk"] #npcFarSlot,
  .modal-box[data-mkind="npc_talk"] #npcActionsSlot,
  .modal-box[data-mkind="npc_talk"] #npcGiftSlot,
  .modal-box[data-mkind="npc_talk"] #npcChatForm,
  .modal-box[data-mkind="npc_talk"] #npcFactsSlot {
    flex: none;
  }
  .modal-box[data-mkind="npc_talk"] .npc-head {
    padding: 8px 11px;
    gap: 10px;
  }
  .modal-box[data-mkind="npc_talk"] .npc-portrait-wrap {
    width: 58px;
    height: 58px;
    border-radius: 14px;
  }
  .modal-box[data-mkind="npc_talk"] .npc-head-info {
    gap: 3px;
  }
  .modal-box[data-mkind="npc_talk"] .npc-name-row h3 {
    font-size: 15px;
  }
  .modal-box[data-mkind="npc_talk"] .npc-bio {
    font-size: 11.4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .modal-box[data-mkind="npc_talk"] .npc-bars {
    padding: 7px 10px;
    gap: 5px;
  }
  .modal-box[data-mkind="npc_talk"] .npc-req-card {
    padding: 6px 10px;
    gap: 6px 10px;
  }
  .modal-box[data-mkind="npc_talk"] .npc-far-banner {
    padding: 6px 10px;
    font-size: 11.5px;
  }
  .modal-box[data-mkind="npc_talk"] .npc-gift-grid {
    max-height: 122px;
  }
  .modal-box[data-mkind="npc_talk"] .npc-chat-log {
    flex: 1 1 150px;
    min-height: 110px;
    max-height: none;
    overflow-y: auto;
  }
  .modal-box[data-mkind="npc_talk"] .npc-actions .btn.sm {
    min-height: 30px;
    padding: 3.5px 9px;
    font-size: 11.3px;
  }
  .modal-box[data-mkind="npc_talk"] .npc-form .inp,
  .modal-box[data-mkind="npc_talk"] .npc-form .btn {
    height: 38px;
    min-height: 38px;
  }
}
@media (min-width: 760px) and (max-height: 580px) {
  .modal-box[data-mkind="npc_talk"] {
    height: auto;
  }
  .modal-box[data-mkind="npc_talk"] .m-body {
    overflow-y: auto;
  }
  .modal-box[data-mkind="npc_talk"] .npc-chat-log {
    flex: 0 0 auto;
    max-height: 180px;
  }
}

@media (max-width: 759px) {
  .date-hud {
    max-width: calc(100vw - 122px);
    padding: 5.5px 8px;
    gap: 4px;
    border-radius: 14px;
  }
  .date-hud-who { font-size: 11px; }
  .date-goal-pill { font-size: 9.8px; padding: 2px 6px; }
  .date-hud-btn { font-size: 10px; padding: 3.5px 7px; }
}
@media (max-width: 560px) {
  .npc-head { padding: 9px 10px; gap: 9px; }
  .npc-portrait-wrap { width: 64px; height: 64px; border-radius: 14px; }
  .npc-name-row h3 { font-size: 14.5px; }
  .npc-bars-grid { grid-template-columns: 1fr; gap: 7px; }
  .npc-needs-mini { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; }
  .npc-need-m { padding: 2px 3.5px; gap: 2.5px; }
  .npc-chat-log { max-height: 195px; padding: 8px 9px; }
  .npc-msg { max-width: 92%; font-size: 12.2px; }
  .npc-cards-grid { grid-template-columns: 1fr; gap: 8px; }
  .npc-gift-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .npc-clerk-banner { padding: 7px 9px; }
  .npc-clerk-banner .btn.sm { width: 100%; }
}
