/*
 * Warsmith WebApp — Forge-Glass screen layout & components.
 * Ported from the approved Forge-Glass mockup (cinematic stage + glass
 * cards + gold accent). Built on the vendored tokens (assets/ui/tokens.css)
 * and base material (assets/ui/base.css — .glass, .scrim, .spark): this file
 * owns layout/screens, not the shared material itself.
 *
 * Unlike the mockup (a phone bezel floating on a desk, for demoing on a
 * desktop page), this is the REAL app running inside Telegram's WebView —
 * already full-screen on the user's phone — so there's no bezel/notch/shadow
 * here: the cinematic stage+scrim+sparks are the real page background, and
 * #app fills the viewport directly (single phone-width column, mobile-first).
 */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 var(--space-2);
  letter-spacing: 0.01em;
}

p {
  margin: 0 0 var(--space-3);
  color: var(--ink-muted);
}

button,
input,
select {
  font-family: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

/* === Game-semantic tokens (vitals/grades/status) — additive to tokens.css == */
:root {
  --hp: #b5514c;
  --mp: #5c86c0;
  --cp: #cf9a5a;
  --vit: #57b8a4;
  --ok: #93d595;
  --warn: #e6c173;
  --crit: #cf5b54;
  --r-common: #a7a39a;
  --r-uncommon: #82bb8c;
  --r-rare: #6f97cf;
  --r-epic: #a98ad6;
  --r-legend: #e6c173;
}

/* === Cinematic backdrop (real viewport, not a phone bezel) =================== */
.stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(60% 50% at 72% 22%, rgba(255, 196, 120, 0.3), transparent 60%),
    radial-gradient(80% 70% at 18% 16%, rgba(86, 120, 210, 0.34), transparent 65%),
    radial-gradient(120% 90% at 50% 122%, rgba(20, 16, 40, 0.92), transparent 60%),
    linear-gradient(180deg, #1a1f3a 0%, #241a35 45%, #120f1c 100%);
  animation: drift 26s var(--ease) infinite alternate;
  transform-origin: 60% 40%;
}
@keyframes drift {
  from {
    transform: scale(1.04) translate(0, 0);
  }
  to {
    transform: scale(1.12) translate(-1.5%, 1%);
  }
}
.sparks {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.scrim {
  z-index: 2;
}

@media (prefers-reduced-motion: reduce) {
  .stage {
    animation: none;
    transform: scale(1.06);
  }
}

/* === App shell =============================================================== */
.app {
  position: relative;
  z-index: 3;
  max-width: 480px;
  margin: 0 auto;
  /* Lock the shell to the viewport height and scroll ONLY the middle (.viewport /
     .screen), so the header (appbar + xpstrip) stays pinned to the top and the
     nav (tabbar) to the bottom — a proper mobile app shell. */
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Simple header for pre-main screens (loading/login/home/create-*) — the
   full appbar+xpstrip is reserved for the tabbed 'main' shell. */
.topbar {
  position: relative;
  z-index: 5;
  flex: 0 0 auto; /* pinned to the top; .screen below it scrolls */
  padding: 20px 16px 12px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(12, 13, 18, 0.5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
}
.topbar .brand {
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.3px;
}
.topbar .brand .dia {
  color: var(--accent);
  text-shadow: 0 0 14px var(--accent-glow);
}
.topbar .meta {
  font-size: 0.75rem;
  color: var(--ink-muted);
}

/* === Generic layout =========================================================== */
.screen {
  flex: 1 1 0;
  min-height: 0; /* scroll within the shell (pre-main screens) instead of growing it */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 14px 26px;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.row.between {
  justify-content: space-between;
}
.row.wrap {
  flex-wrap: wrap;
}

/* List column for potentially long lists (hunting zones, the bag, quests,
   a shop's goods). #6827: it used to be a nested scroller capped at 46vh,
   which left empty space under it on a tall screen and put a second
   scrollbar inside the page. Now there is ONE scroller per screen — the
   viewport (main.viewport, data-scroll-key="viewport") — and every list
   simply takes the height its rows need; applyViewScroll still restores each
   screen's own offset (A → B → A) through the viewport's scroll key. */
.list-scroll {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.head {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 2px;
}
.eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-strong);
}
.h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.1;
}

/* .back-link is a plain in-screen "go back" row (e.g. renderCraftScreen's
   ‹ Персонаж / ‹ Книга рецептов) — no border, no sheet chrome, just a small
   muted tap target above the .head. */
.back-link {
  align-self: flex-start;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 14px;
  padding: 6px 0;
  cursor: pointer;
}

.card {
  padding: 13px 15px;
}
.lbl {
  font-size: 11px;
  color: var(--ink-muted);
}
.num {
  font-variant-numeric: tabular-nums;
}
.note {
  font-size: 11px;
  color: var(--ink-muted);
  line-height: 1.45;
}
.note b {
  color: var(--accent-strong);
}

.pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  color: var(--ink-muted);
  white-space: nowrap;
}
.pill.gold {
  border-color: var(--accent);
  color: var(--accent-strong);
}
.pill.crit {
  border-color: var(--crit);
  color: var(--crit);
}

.seg {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 3px;
  gap: 3px;
}
.seg button {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  padding: 8px 4px;
  border-radius: 9px;
  cursor: pointer;
  min-height: 36px;
}
.seg button[aria-selected="true"] {
  background: rgba(201, 162, 75, 0.16);
  color: var(--accent-strong);
}
/* Denser variant for the inventory's 6-way category filter. */
.seg.multi {
  flex-wrap: wrap;
}
.seg.multi button {
  flex: 1 1 30%;
  font-size: 10.5px;
  padding: 7px 3px;
}

/* Secondary filter row (#6792, quest groups): small pill chips on one line,
   scrolling sideways with snap when they don't fit, never wrapping. Lighter
   than .seg so it reads as a sub-filter of the tabs above it. The edge fade
   shows only on the side you can scroll toward (updateChipRowFade). */
.chip-row {
  display: flex;
  gap: 5px;
  margin-top: 10px;
  padding: 1px 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.chip-row::-webkit-scrollbar {
  display: none;
}
.chip-row button {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink-muted);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  line-height: 1;
  padding: 7px 9px;
  border-radius: 999px;
  min-height: 30px;
  cursor: pointer;
}
.chip-row button[aria-selected="true"] {
  border-color: rgba(201, 162, 75, 0.5);
  background: rgba(201, 162, 75, 0.14);
  color: var(--accent-strong);
}
.chip-row button .n {
  font-weight: 500;
  font-size: 11px;
  opacity: 0.65;
  font-variant-numeric: tabular-nums;
}
.chip-row.can-right {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
}
.chip-row.can-left {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px);
  mask-image: linear-gradient(90deg, transparent, #000 28px);
}
.chip-row.can-left.can-right {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent);
}

.bar {
  height: 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: 6px;
}
.bar.big {
  height: 14px;
}
.bar.gold > i {
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  box-shadow: 0 0 12px var(--accent-glow);
}
.bar.warn > i {
  background: var(--warn);
}
.bar.crit > i {
  background: var(--crit);
  box-shadow: 0 0 10px rgba(207, 91, 84, 0.4);
}
/* Enemy (current-target) HP bar — always red. */
.bar.enemy > i {
  background: linear-gradient(90deg, #b5514c, #cf5b54);
  box-shadow: 0 0 10px rgba(207, 91, 84, 0.4);
}

/* === Buttons ================================================================== */
.btn {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-btn);
  padding: 10px 14px;
  min-height: 44px;
  color: var(--on-accent);
  border: 1px solid transparent;
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  box-shadow:
    0 6px 18px var(--accent-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition:
    transform 0.15s var(--ease),
    box-shadow 0.2s;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 10px 26px var(--accent-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn:active {
  transform: translateY(0);
}
.btn--outline {
  background: var(--glass-bg);
  color: var(--ink);
  border: 1px solid var(--glass-border);
  box-shadow: none;
}
.btn--outline:hover {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(201, 162, 75, 0.25);
  transform: translateY(-1px);
}
.btn--ghost {
  background: transparent;
  border: 0;
  color: var(--ink-muted);
  box-shadow: none;
  padding: 8px 10px;
  min-height: auto;
}
.btn--ghost:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  transform: none;
  box-shadow: none;
}
/* Danger action (destroy) — reuses the same --crit token as the HP/MP/CP
   crit bar state and .pill.crit, so "irreversible/destructive" reads
   consistently across the app. */
.btn--danger {
  background: var(--glass-bg);
  color: var(--crit);
  border: 1px solid var(--crit);
  box-shadow: none;
}
.btn--danger:hover {
  background: rgba(207, 91, 84, 0.12);
  box-shadow: 0 0 16px rgba(207, 91, 84, 0.25);
  transform: translateY(-1px);
}
.btn.sm {
  padding: 7px 12px;
  min-height: 36px;
  font-size: 12px;
  border-radius: 9px;
}
.btn.block {
  width: 100%;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* === Forms ==================================================================== */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.field label {
  font-size: 0.78rem;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}
.input {
  appearance: none;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  border-radius: var(--radius-btn);
  padding: 0.7rem 0.85rem;
  font-size: 1rem;
  min-height: 44px;
}
.input:focus {
  border-color: var(--accent);
}
/* .select is .input's <select> modifier (e.g. the Рынок city switcher) — same
   Forge-Glass chrome, plus a small custom chevron since .input already
   strips the native one (appearance: none). */
.select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%),
    linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) center,
    calc(100% - 14px) center;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.2rem;
  /* .input's background is only 25% black, so on a UA that still paints a light
     default control the closed <select> came out grey. Pin a near-opaque --bg
     wash instead, and declare the dark scheme so the popup list — drawn by the
     OS, not by this stylesheet — stops rendering light on Windows. */
  background-color: rgba(14, 15, 19, 0.72);
  color-scheme: dark;
}
/* Belt and braces for engines that ignore color-scheme on the control itself. */
.select option {
  background: var(--bg);
  color: var(--ink);
}
.hint {
  font-size: 0.78rem;
  color: var(--ink-muted);
}
.error-banner {
  border: 1px solid rgba(220, 90, 90, 0.4);
  background: rgba(120, 30, 30, 0.25);
  color: #f0c9c9;
  border-radius: var(--radius-panel);
  padding: var(--space-3);
  font-size: 0.85rem;
}
/* Account-session-lost banner (ADR-0021, WS3): a standing notice on the
   account-login step, gold-toned rather than red — it isn't an error, it's
   an explanation of why the app dropped back to this screen. */
.session-banner {
  border: 1px solid var(--accent-glow);
  background: rgba(201, 162, 75, 0.12);
  color: var(--ink);
  border-radius: var(--radius-panel);
  padding: var(--space-3);
  font-size: 0.85rem;
}
.toggle-group {
  display: flex;
  gap: var(--space-2);
}
.toggle-btn {
  flex: 1;
}
.toggle-btn[aria-pressed="true"] {
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  color: var(--on-accent);
  border-color: transparent;
  box-shadow: 0 4px 14px var(--accent-glow);
}

/* Left/right toggle switch (e.g. «Баффы новичка») — label + a pill that slides. */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.switch-label {
  font-size: 13px;
}
.switch {
  flex: none;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.07);
  position: relative;
  cursor: pointer;
  padding: 0;
  transition: background 0.18s ease;
}
.switch[aria-checked="true"] {
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  border-color: transparent;
}
.switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: left 0.18s ease;
}
.switch[aria-checked="true"] .switch-knob {
  left: 22px;
}

/* === Spinner / empty state ==================================================== */
.spinner-wrap {
  display: flex;
  justify-content: center;
  padding: var(--space-7) 0;
}
.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--glass-border);
  border-top-color: var(--accent);
  animation: spin 800ms linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
    border-top-color: var(--glass-border);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.empty-state {
  text-align: center;
  padding: var(--space-7) var(--space-3);
  color: var(--ink-muted);
}
.empty-state .glyph {
  font-size: 2.2rem;
  display: block;
  margin-bottom: var(--space-2);
  color: var(--accent);
  opacity: 0.85;
}
.empty-state .title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: var(--space-1);
}

/* === Login screen ============================================================= */
.login-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-5);
  padding: var(--space-5);
}
.login-screen .brand-lg {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 600;
  color: var(--accent);
  text-shadow: 0 0 22px var(--accent-glow);
}
.login-screen .brand-lg .dia {
  color: var(--accent-strong);
}
.login-screen .card {
  width: 100%;
}

/* === Home / onboarding (accounts + characters, pre character-selection) ======= */
.account-row {
  padding: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.badge {
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.badge.active {
  color: var(--accent-strong);
  border-color: var(--accent-glow);
}
/* .badge.playing is WS4's "in play" language: a held account session
   («В игре») and, when a hunt is running on it, «⚔ Охота» — the single gold
   accent, no new colours (ADR-0013). */
.badge.playing {
  color: var(--accent-strong);
  border-color: var(--accent-glow);
  background: rgba(201, 162, 75, 0.14);
}

/* === Class picker (create character) ========================================== */
.grid-classes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}
.class-card {
  padding: var(--space-3);
  text-align: left;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  border-radius: var(--radius-panel);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition:
    border-color 120ms var(--ease),
    box-shadow 120ms var(--ease);
}
.class-card:hover {
  border-color: var(--accent-glow);
}
.class-card[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow);
}
.class-card .name {
  font-family: var(--font-display);
  font-size: 1rem;
}
.class-card .race {
  font-size: 0.78rem;
  color: var(--ink-muted);
}
.class-card .tag {
  align-self: flex-start;
  margin-top: 0.2rem;
  font-size: 0.65rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}
.class-card .tag.mystic {
  color: var(--accent-strong);
  border-color: var(--accent-glow);
}

/* === App bar (main tabbed shell) =============================================== */
.appbar {
  position: relative;
  z-index: 5;
  flex: 0 0 auto; /* pinned to the top of the app shell */
  padding: 20px 14px 11px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(12, 13, 18, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
}
.brand {
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.brand .dia {
  color: var(--accent);
  text-shadow: 0 0 14px var(--accent-glow);
}
.charsel {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--ink-muted);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  font-family: var(--font-body);
  max-width: 52%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.charsel .cs-name {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.charsel .cs-fix,
.charsel .acc-count {
  flex: none;
}
.charsel .acc-count {
  margin-left: 0;
}
.charsel .dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}
.adena {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 6px 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 12.5px;
  white-space: nowrap;
}
.coin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex: none;
  background: radial-gradient(circle at 35% 30%, var(--accent-strong), var(--accent) 72%);
  box-shadow:
    0 0 8px var(--accent-glow),
    inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.coin.sm {
  width: 12px;
  height: 12px;
}

/* Persistent character-status strip (renderXpStrip) — pinned under the
   appbar on EVERY tab (renderMain), not just the hunt view. Two tight rows:
   row1 = level chip + gold XP bar + XP% + SP; row2 = mini HP/MP/CP/Vitality
   bars (.xpstrip-vitals, a compact variant of the Character tab's .vitals
   grid). Kept deliberately shallow (small paddings/font-sizes) since it
   permanently eats vertical space above the tab content on a phone screen. */
.xpstrip {
  position: relative;
  z-index: 5;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px 13px 7px;
  background: rgba(12, 13, 18, 0.5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
}
.xpstrip-row1 {
  display: flex;
  align-items: center;
  gap: 9px;
}
/* #7069: the level is a bare number in a rounded-square badge — grey by
   default, gold with a soft glow on a Premium Account (.lv--pa) — followed
   by the character name and its muted title. */
.xpstrip .lv {
  flex: none;
  box-sizing: border-box;
  width: 26px;
  height: 26px;
  aspect-ratio: 1 / 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-muted);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.xpstrip .lv--pa {
  border-color: var(--accent);
  background: rgba(201, 162, 75, 0.12);
  color: var(--accent-strong);
  box-shadow: 0 0 8px rgba(201, 162, 75, 0.45), inset 0 0 6px rgba(201, 162, 75, 0.18);
  text-shadow: 0 0 6px rgba(201, 162, 75, 0.5);
}
.xpstrip .xp-who {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
}
.xpstrip .xp-name {
  flex: 0 0 auto; /* never shrinks while the title still has room to give */
  max-width: 100%; /* a name longer than the row ellipsizes */
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}
.xpstrip .xp-title {
  flex: 0 1000 auto; /* the title gives its room up before the name does */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  color: var(--ink-muted);
}
.xpstrip .sp {
  font-size: 10px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.xpstrip .sp b {
  color: var(--ink);
  font-weight: 700;
}

/* Level-up flash (#6760): the strip glows gold for ~2.4 s and a «Новый
   уровень!» tag pops next to the level chip, together with levelup.ogg. */
.xpstrip--levelup {
  animation: xpstrip-levelup 2.4s var(--ease) both;
}
.xpstrip--levelup .lv {
  color: var(--accent-strong);
  text-shadow: 0 0 10px var(--accent-glow);
}
.xpstrip-lvup {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  color: var(--accent-strong);
  white-space: nowrap;
  animation: xpstrip-lvup-pop 0.5s var(--ease) both;
}
@keyframes xpstrip-levelup {
  0% { box-shadow: inset 0 0 0 1px transparent; background-color: rgba(12, 13, 18, 0.5); }
  18% { box-shadow: inset 0 0 0 1px var(--accent), 0 0 22px var(--accent-glow); background-color: rgba(201, 162, 75, 0.16); }
  100% { box-shadow: inset 0 0 0 1px transparent; background-color: rgba(12, 13, 18, 0.5); }
}
@keyframes xpstrip-lvup-pop {
  0% { opacity: 0; transform: scale(0.6); }
  60% { opacity: 1; transform: scale(1.12); }
  100% { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .xpstrip--levelup,
  .xpstrip-lvup { animation: none; }
}

/* Mini vital bars (HP/MP/CP/Vitality) — same markup as the Character tab's
   .vitals cells (renderVitalCell reused verbatim) but tighter: smaller label
   text and a thinner bar so the permanent strip stays compact. Column count
   is set inline per-render (2-4 cols) to fit however many vitals are
   currently available; overqualified selectors below (.xpstrip .xpstrip-vitals
   ...) win over the base .vitals/.bar rules regardless of source order. */
.xpstrip .xpstrip-vitals {
  gap: 6px;
  margin-top: 1px;
}
.xpstrip .xpstrip-vitals .vlbl {
  font-size: 8.5px;
  margin-bottom: 2px;
}
.xpstrip .xpstrip-vitals .bar {
  height: 4px;
}
/* Full-width XP-to-next-level progress bar across the bottom of the strip,
   with the current XP % centered on it (.xpbar-pct, #6712) and a little air
   under it before the strip's border (#6711). The label is light ink with a
   dark outline/shadow so it stays legible over the gold fill and over the
   dark empty track alike. */
.xpstrip .xpstrip-xpbar {
  position: relative;
  margin-top: 8px;
  margin-bottom: 4px;
}
.xpstrip .xpstrip-xpbar .bar {
  display: block;
  width: 100%;
  height: 13px;
}
.xpstrip .xpbar-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow:
    0 0 2px rgba(0, 0, 0, 0.95),
    0 0 4px rgba(0, 0, 0, 0.8);
  -webkit-text-stroke: 0.3px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

/* === Viewport / screens ======================================================== */
.viewport {
  position: relative;
  z-index: 4;
  flex: 1 1 0;
  min-height: 0; /* allow it to shrink below content so it scrolls internally */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

/* === Character strip / power / stats ========================================== */
.charstrip {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.charstrip .top {
  display: flex;
  align-items: center;
  gap: 11px;
}
.portrait {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 24px;
  background: radial-gradient(circle at 40% 30%, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--glass-border);
}
.cname {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.1;
}
.cmeta {
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-top: 2px;
}

/* EXP bar (level + exp_percent toward next level) inside the charstrip card. */
.xp {
  margin-top: 4px;
}
.xp .xhead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 10.5px;
  color: var(--ink-muted);
  margin-bottom: 4px;
}
.xp .xhead b {
  color: var(--ink);
  font-size: 12px;
}
.xp .lvl {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-strong);
}

/* HP/MP/CP vitals (cur/max), 3-col — any vital with max=0 is omitted. */
.vitals {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.vitals .vlbl {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.power {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 15px;
}
.power .pv {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--accent-strong);
  text-shadow: 0 0 22px var(--accent-glow);
  font-variant-numeric: tabular-nums;
}
.power .pl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  line-height: 1.3;
}
.statgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 14px;
}
.stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
}
.stat:nth-last-child(-n + 2) {
  border-bottom: 0;
}
.stat .sl {
  color: var(--ink-muted);
}
.stat .sv {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Base STR/DEX/CON/INT/WIT/MEN — hidden entirely when the backend leaves
   them at 0 (see renderBaseStats in app.js). */
.basestats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  text-align: center;
}
.basestats .bs {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 9px;
  padding: 7px 2px;
}
.basestats .bs .bl {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}
.basestats .bs .bv {
  font-weight: 800;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

/* === Elemental attributes (character sheet "Атрибуты") — a 3x2 grid of
   element/defence cells, same tile language as .basestats. Cells at 0 dim
   out so the ones the character actually has stand out. */
.attrgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  text-align: center;
}
.attrgrid .attr {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 9px;
  padding: 7px 2px;
}
.attrgrid .attr.zero {
  opacity: 0.45;
}
.attrgrid .al {
  font-size: 10px;
  color: var(--ink-muted);
  white-space: nowrap;
}
.attrgrid .av {
  font-weight: 800;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
  color: var(--accent-strong);
}
.attrgrid .attr.zero .av {
  color: var(--ink-muted);
}

/* Per-group skill count in the skills tab's eyebrow headings. */
.eyebrow .sg-count {
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}

/* === Paperdoll — real HF paperdoll slots grouped visually ====================== */
.paperdoll {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 9px;
  align-items: start;
}
.pd-col {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.pd-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
}
.pd-silh {
  font-size: 48px;
  line-height: 1;
  filter: grayscale(0.3) drop-shadow(0 4px 14px rgba(0, 0, 0, 0.5));
}
.pd-weapons {
  display: flex;
  gap: 7px;
  width: 100%;
  justify-content: center;
}
.pd-slot {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.pd-slot .pi {
  font-size: 20px;
  line-height: 1;
  opacity: 0.6;
}
.pd-slot .pi img {
  width: 82%;
  height: 82%;
  object-fit: contain;
}
.pd-slot.empty {
  border-style: dashed;
}
.pd-slot.empty .pi {
  font-size: 14px;
  color: var(--ink-muted);
  opacity: 0.55;
}
.pd-slot .pg {
  position: absolute;
  right: 2px;
  bottom: 1px;
  font-size: 8px;
  font-weight: 800;
  padding: 0 2px;
  border-radius: 4px;
  background: rgba(11, 12, 16, 0.85);
}
.pd-accessories {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 9px;
}
.pd-accessories .pd-slot {
  width: auto;
}
.pd-hint {
  font-size: 10.5px;
  color: var(--ink-muted);
  margin-top: 8px;
  text-align: center;
}

/* === Item icon tiles ============================================================ */
.icon-tile {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-tile img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}
.icon-tile.placeholder {
  color: var(--accent-strong);
  font-size: 1.1rem;
  opacity: 0.85;
}

/* === Inventory grid ============================================================= */
.invmeta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--ink-muted);
}
/* Weight/slot usage meter (invmeta line + thin bar) — see renderInvMeta. */
.invmeta-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.invmeta .num {
  color: var(--ink);
  font-weight: 700;
}
.grid {
  display: grid;
  /* Fixed-size bag tiles (#6718): the old minmax(52px, 1fr) + aspect-ratio
     cells were sized from the grid's own box, and the grid sits as a flex
     item inside the height-capped .list-scroll column, so the tile (and its
     icon) could change with the number of rows / the scrollbar. Now every
     track is a fixed 52px square (like the skill tiles' fixed look), the
     grid never shrinks inside the scroller (flex: none), and the spare row
     width goes into the column gaps instead of the tiles. */
  grid-template-columns: repeat(auto-fill, 52px);
  grid-auto-rows: 52px;
  justify-content: space-between;
  gap: 6px;
  flex: none;
}
.cell {
  width: 52px;
  height: 52px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  position: relative;
  display: grid;
  place-items: center;
  font-size: 15px;
  cursor: pointer;
  overflow: hidden;
}
.cell::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9px;
  border: 1.5px solid transparent;
  pointer-events: none;
}
.cell[data-r="uncommon"]::after {
  border-color: color-mix(in srgb, var(--r-uncommon) 65%, transparent);
}
.cell[data-r="rare"]::after {
  border-color: color-mix(in srgb, var(--r-rare) 70%, transparent);
  box-shadow: inset 0 0 13px color-mix(in srgb, var(--r-rare) 26%, transparent);
}
.cell[data-r="epic"]::after {
  border-color: color-mix(in srgb, var(--r-epic) 72%, transparent);
  box-shadow: inset 0 0 15px color-mix(in srgb, var(--r-epic) 30%, transparent);
}
.cell[data-r="legend"]::after {
  border-color: var(--accent);
  box-shadow: inset 0 0 17px var(--accent-glow);
}
.cell .qty {
  position: absolute;
  right: 2px;
  bottom: 2px;
  font-size: 9px;
  font-weight: 700;
  color: var(--ink);
  background: rgba(11, 12, 16, 0.8);
  padding: 0 3px;
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
}
.cell .eq {
  position: absolute;
  left: 4px;
  top: 4px;
  font-size: 9px;
  font-weight: 800;
  color: var(--accent-strong);
  background: rgba(11, 12, 16, 0.7);
  padding: 0 3px;
  border-radius: 4px;
}
.cell.empty {
  background: rgba(255, 255, 255, 0.015);
  cursor: default;
}

/* === Skills grid (character sheet "Умения") — same icon-tile language as
   the inventory grid but deliberately denser: a character knows dozens of
   skills, so the tiles are small (auto-fill ~44px, as many per row as fit)
   and carry only the level as a corner badge. Each tile is a button that
   opens the skill-detail sheet (renderSkillSheet). */
.skillgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
}
.scell {
  aspect-ratio: 1;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.scell:active {
  border-color: var(--accent);
}
.scell .lvl.ench {
  color: var(--accent-strong);
}
.scell .lvl {
  position: absolute;
  right: 2px;
  bottom: 1px;
  font-size: 9px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--accent-strong);
  background: rgba(11, 12, 16, 0.82);
  padding: 0 3px;
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
}

/* The skill-detail sheet's description paragraph (Skill.desc, straight from
   the client's skill text) — plain readable prose under the kind chips. */
.skill-desc {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-muted);
  white-space: pre-line;
}

/* === Expeditions (real data — defs + active accrual) ============================ */
.exp-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.exp-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}
.exp-loot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 9px;
  padding: 4px 8px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
/* Quest reward/goal chips (questRewardChip/renderQuestJournalGoals/
   renderQuestGoalList): l2-mappings icon files vary in native pixel size,
   so an unsized .icon-tile inside a chip rendered each reward/goal icon at a
   different size (issue 2). Fix the frame to one size here — lower
   specificity than .chip.removable's own 16px rule below, so that variant
   is unaffected. */
.chip .icon-tile {
  width: 18px;
  height: 18px;
  flex: none;
}
/* «Экспедиции» zone search (#7251): the monster the query matched. */
.chip.hit {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: rgba(201, 162, 75, 0.14);
}
/* «Последняя локация» (#7247): the last hunt's zone over the zone list. */
.hunt-last {
  margin-bottom: var(--space-3);
  border-color: var(--accent);
}
.hunt-last .hunt-last-lock {
  margin-top: 10px;
  color: var(--warn);
}
.zone-search {
  margin-top: var(--space-3);
}
.timecap {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-muted);
  margin-bottom: 4px;
}
.expitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.expitem:last-child {
  border-bottom: 0;
}
.expitem .ei {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  overflow: hidden;
}
.expitem.locked {
  opacity: 0.5;
}
.expitem .info {
  flex: 1;
  min-width: 0;
}
.expitem .info b {
  font-size: 13px;
  font-weight: 600;
}
.expitem .info .sub {
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 2px;
}

/* Third .pill tint (gold/crit already existed) — used by the hunting zone
   card's fitness hint for the "toughening but doable" middle band. */
.pill.warn {
  border-color: var(--warn);
  color: var(--warn);
}

/* === Рынок (NPC city shops) ===================================================== */
/* A shop card's own item list: the same page-scrolled column (#6827) — a
   shop card is collapsible, so an open one just shows all its goods. */
.list-scroll.sm {
  gap: var(--space-2);
}
.shop-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Рынок search box (filters shop items by name) — a magnifier + input + clear. */
.market-search {
  position: relative;
  display: flex;
  align-items: center;
  margin: 2px 0 10px;
}
.market-search .mag {
  position: absolute;
  left: 11px;
  font-size: 13px;
  opacity: 0.6;
  pointer-events: none;
}
.market-search .input {
  width: 100%;
  padding-left: 32px;
}
.market-search .clear {
  position: absolute;
  right: 8px;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 7px;
}
.market-search .clear:hover {
  color: var(--ink);
}

/* Typed quantity field in the grocery qty-stepper (between the − / + buttons). */
.qty-input {
  width: 46px;
  text-align: center;
  padding: 6px 4px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
}
.qty-input:focus {
  outline: none;
  border-color: var(--accent);
}
/* .shop-card-head is now a disclosure button (data-action="shop-toggle",
   see renderShopCard/onClick) — tappable like .pickrow/.cell, with a
   trailing item-count badge + open/closed caret. */
.shop-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border-radius: 10px;
  margin: -4px;
  padding: 4px;
  transition: background 0.15s;
}
.shop-card-head:hover,
.shop-card-head:focus-visible {
  background: rgba(255, 255, 255, 0.04);
}
.shop-card-head .title {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
}
.shop-card-head .npc {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 40%;
  font-size: 11px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop-card-head .count {
  flex: none;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-muted);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 1px 7px;
  font-variant-numeric: tabular-nums;
}
.shop-card-head .caret {
  flex: none;
  width: 14px;
  text-align: center;
  color: var(--accent-strong);
  font-size: 11px;
}
/* .shop-row reuses .pickrow's icon+info row shape (see the loadout pickers)
   — tapping the row opens the item-detail sheet (data-action="shop-item-tap",
   see renderShopItemRow/openItemDetailsSheet); .pickrow's own cursor:pointer
   already applies (no override needed here), it also hosts its own nested
   qty stepper + Buy button (their own data-action wins on click — see
   renderShopItemRow's doc). */
.shop-row .pinfo {
  min-width: 0;
}
.shop-row .psub {
  display: flex;
  align-items: center;
  gap: 4px;
}
.shop-row .btn.sm {
  flex: none;
}
.qty-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.qty-stepper .btn.sm {
  min-height: 28px;
  padding: 0 9px;
}
.qty-stepper .num {
  min-width: 14px;
  text-align: center;
  font-size: 12px;
}

/* === Охота (auto-hunting): live projection stat grid + warning banner ===== */
.hunt-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.hunt-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 8px 9px;
}
.hunt-stats .num {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-strong);
}
.hunt-warn {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(207, 91, 84, 0.12);
  border: 1px solid var(--crit);
  color: var(--crit);
  font-size: 11.5px;
  line-height: 1.4;
}

/* Hunt-SESSION summary (running totals since StartHunt/StartHuntSession —
   not a single interval, see HuntSession/HuntSessionState/renderActiveHunt)
   — a subtle glass panel with a gold left-accent so it reads as "the big
   number" above the rest of the card. Shared by both the old tick-sim
   flow's session totals and the real-engine session's own totals — same
   visual role in both. */
.hunt-session {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--accent);
}
.hunt-session .hs-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.hunt-session .hs-sub {
  margin-top: 3px;
  font-size: 11px;
  color: var(--ink-muted);
}

/* === Party social shell (shared Expedition/Raid direction) ================== */
.party-card {
  margin-top: 2px;
}
.party-pref-row {
  margin-top: 12px;
}
.party-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
/* The roster card is dense (badges, member rows, action buttons), so the loot
   control is a compact label+select ROW rather than the tall stacked .field the
   onboarding/market screens use — otherwise it reads as a slab in the middle
   of the card. */
.party-loot-field {
  margin-top: 12px;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
.party-loot-field label {
  flex: none;
}
.party-loot-field .select {
  flex: 1;
  min-width: 0;
  min-height: 34px;
  padding: 0.3rem 2rem 0.3rem 0.65rem;
  font-size: 0.85rem;
  background-position:
    calc(100% - 16px) center,
    calc(100% - 10px) center;
}
.party-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.party-row {
  align-items: flex-start;
}
.party-row-side {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.party-actions {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.party-actions .btn.sm,
.party-row-side .btn.sm {
  min-width: 110px;
}
.party-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.party-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-muted);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 2px 7px;
  white-space: nowrap;
}
.party-badge.ok {
  color: var(--accent-strong);
  border-color: rgba(201, 162, 75, 0.45);
  background: rgba(201, 162, 75, 0.12);
}
.party-empty {
  padding: 18px 12px;
}
.party-add-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.party-add-form .input {
  flex: 1 1 auto;
  min-width: 0;
}
.party-add-form .btn.sm {
  flex: none;
}
.party-card-actions {
  margin-top: 12px;
}

/* Real-engine hunt session's own live HP/MP/CP + level/XP% snapshot (see
   HuntSessionState/renderActiveHunt) — reuses the shared .vitals grid
   (renderVitalCell) with just a small margin + a level/XP sub-line under it,
   mirroring .hunt-session's .hs-sub tone/size below its own totals row. */
.hunt-vitals {
  margin-top: 10px;
}
.hunt-vitals .hv-sub {
  margin-top: 6px;
  text-align: right;
  font-size: 11px;
  color: var(--ink-muted);
}

/* Real-engine hunt session's current-target HP bar (see
   renderHuntTargetBar) — a labeled row ("Цель: {name}" + %) over a .bar.big,
   tinted .crit under a quarter health like every other low-HP bar in the
   app, .gold otherwise. */
.hunt-target {
  margin-top: 10px;
}
.hunt-target-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

/* Session loot carousel (state.huntSession.loot — every distinct item looted
   this hunt, merged by item id, most-looted-first) — a horizontally
   scrolling strip of icon tiles so a long hunt's full haul stays reachable
   without pushing the card's width (the parent .card.glass already
   constrains that). */
.loot-wrap {
  position: relative;
}
.loot-carousel {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 8px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  user-select: none; /* a mouse drag scrolls, it shouldn't select the tiles */
  -webkit-user-select: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.loot-carousel.dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}
/* Suppress selection anywhere while a loot drag is in progress (so an upward
   drag doesn't select the content above the carousel). */
body.loot-dragging {
  user-select: none;
  -webkit-user-select: none;
}
/* Edge fade only on the side(s) you can actually scroll toward — a soft "more
   this way" cue that matches the direction arrows (see updateLootHint). */
.loot-wrap.can-right .loot-carousel {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent);
}
.loot-wrap.can-left .loot-carousel {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 30px);
  mask-image: linear-gradient(90deg, transparent, #000 30px);
}
.loot-wrap.can-left.can-right .loot-carousel {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 30px, #000 calc(100% - 30px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 30px, #000 calc(100% - 30px), transparent);
}
/* Direction-aware "‹ ›" nudges: each shows ONLY when that way is scrollable. */
.loot-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-58%);
  pointer-events: none;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent-strong);
  text-shadow: 0 0 8px var(--accent-glow);
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2;
}
.loot-nav.left {
  left: 1px;
}
.loot-nav.right {
  right: 2px;
}
.loot-wrap.can-left .loot-nav.left {
  opacity: 1;
  animation: loot-nudge-l 1.1s var(--ease) infinite;
}
.loot-wrap.can-right .loot-nav.right {
  opacity: 1;
  animation: loot-nudge-r 1.1s var(--ease) infinite;
}
@keyframes loot-nudge-r {
  0%,
  100% {
    transform: translateY(-58%) translateX(0);
  }
  50% {
    transform: translateY(-58%) translateX(3px);
  }
}
@keyframes loot-nudge-l {
  0%,
  100% {
    transform: translateY(-58%) translateX(0);
  }
  50% {
    transform: translateY(-58%) translateX(-3px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .loot-nav {
    animation: none !important;
  }
}
.loot-carousel::-webkit-scrollbar {
  display: none;
}
.loot-cell {
  flex: 0 0 auto;
  width: 54px;
  position: relative;
  text-align: center;
  scroll-snap-align: start;
}
.loot-cell .icon-tile {
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
}
.loot-cell .loot-cnt {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}

/* Active buffs/debuffs strip (renderHuntEffects — session.effects) — a
   .chip variant tinted gold for a buff, red for a debuff, mirroring how
   .pill.warn/.toggle-btn.danger tint the same --accent/--crit tokens
   elsewhere for a positive/negative state. */
.effect-chip.buff {
  border-color: var(--accent);
  color: var(--accent-strong);
}
.effect-chip.debuff {
  border-color: var(--crit);
  color: var(--crit);
}

/* === Боевой набор (manual combat loadout) — card at the top of the hunt
   zone-list view (renderLoadoutPanel). Collapsed by default (just a
   one-line summary) so it doesn't push the zone list below the fold on a
   phone; expands to the 2+3 skill-slot editor + potions row. Slots/rows
   reuse the .icon-tile look (sized down here), not a new icon language. == */
.loadout-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.loadout-summary {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.loadout-chev {
  flex: none;
  color: var(--accent-strong);
  font-size: 11px;
}
.loadout-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.loadout-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.loadout-slots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.loadout-slots-3 {
  grid-template-columns: repeat(3, 1fr);
}
.loadout-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px 7px;
  border: 1px solid var(--glass-border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  cursor: pointer;
  min-width: 0;
}
.loadout-slot .icon-tile {
  width: 26px;
  height: 26px;
}
.loadout-slot .ls-name {
  max-width: 100%;
  font-size: 10px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.loadout-slot .ls-lvl {
  font-size: 9px;
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}
.loadout-slot.empty {
  border-style: dashed;
  color: var(--ink-muted);
}
.loadout-slot .ls-plus {
  font-size: 15px;
  line-height: 1;
  color: var(--accent);
}
.loadout-potions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
/* Fallback-rest range (renderLoadoutPanel's restHtml): the two HP% dropdowns
   sit side by side in a .loadout-row's .row — reusing .field (label+input
   stack) and .input (form-control chrome) as-is, just made to share the row
   evenly instead of each hugging its own content width. */
.loadout-row .row > .field {
  flex: 1;
  min-width: 0;
}
/* Removable chip variant (selected potions) — same .chip base as the loot/
   reward chips elsewhere, plus a truncated name span and an inline ✕
   remove button. Icon sizing is scoped to .removable so the existing
   unsized .chip icon usage (hunt drops / expedition rewards) is untouched. */
.chip.removable {
  padding-right: 4px;
}
.chip.removable .icon-tile {
  width: 16px;
  height: 16px;
  flex: none;
}
/* A configured potion that ran out (#6716): icon + name stay, dimmed and
   desaturated; the ✕ keeps full strength so it's still easy to remove. */
.chip.removable.out {
  border-style: dashed;
}
.chip.removable.out .icon-tile,
.chip.removable.out .chip-txt {
  opacity: 0.45;
  filter: grayscale(0.85);
}
.chip .chip-txt {
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip-x {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  padding: 2px 3px;
}
.chip-x:hover {
  color: var(--crit);
}

/* === Combat log (Журнал боя) — no pre-existing mockup pattern found for
   this anywhere in the repo (checked app.css/app.js and every reference
   mockup under docs/), so .log/.log .l/.c/.h/.d were designed fresh here,
   matching the existing Forge-Glass dark-glass-card language and reusing
   the same --ok/--warn/--crit tokens the HP/MP/CP bars and rarity/pill
   tints already use elsewhere. ================================================ */
.log {
  /* Bounded scroller: the combat log grows with every SimulateHunt tick, so
     it must scroll WITHIN this box rather than pushing the "Забрать" button
     and the bottom tabbar off-screen. render() keeps it pinned to the newest
     line via log.scrollTop = log.scrollHeight after each rebuild, which still
     works inside this bounded height. Kept compact (below the vitals header +
     stat grid the active-hunt view now stacks above it). */
  max-height: 140px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--glass-border);
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-muted);
}
.log .l {
  white-space: normal;
  word-break: break-word;
}
/* .c — crit/kill: the combat "win" beat. */
.log .l.c {
  color: var(--crit);
  font-weight: 600;
}
/* .h — drop: loot/xp, a "gain" beat (reuses --ok, the same green the HP/MP/
   CP-adjacent status tints use elsewhere for "good"). */
.log .l.h {
  color: var(--ok);
}
/* .d — taken/death: damage the character is absorbing. */
.log .l.d {
  color: var(--hp);
}
/* .n — a neutral system line (#6953: «Боевой набор обновлён» mid-hunt):
   not a combat beat, so it steps back instead of taking a beat's colour. */
.log .l.n {
  color: var(--ink-muted);
  font-style: italic;
  opacity: 0.85;
}

/* === World / account / character selector (Мир · Аккаунт · Персонаж) =========== */
.picker {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  background: rgba(6, 7, 10, 0.55);
}
.picker[hidden] {
  display: none;
}
.picker-sheet {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  border-radius: 18px 18px 0 0;
  padding: 14px 14px 18px;
  max-height: 78vh;
  display: flex;
  flex-direction: column;
}
.picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.picker-head b {
  font-family: var(--font-display);
  font-size: 16px;
}
.picker-close {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}
.picker-note {
  font-size: 11px;
  color: var(--ink-muted);
  margin-bottom: 10px;
}
.picker-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* .icon-btn is a bare, borderless icon-only tap target (e.g. the recipe
   detail's trash icon below). */
.icon-btn {
  border: 0;
  background: transparent;
  cursor: pointer;
}
/* .h1-row wraps a .head's title with an inline icon control next to it
   (renderCraftScreen's product title + "Забыть рецепт" trash icon) — .head
   itself stays a column, this row is just the title line. */
.h1-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
/* .recipe-forget (renderCraftScreen) — "Забыть рецепт" is a rare, destructive
   action; keep it a small, muted icon next to the title until armed
   (forgetRecipe's two-tap confirm), when it takes the --crit danger hue and
   .recipe-forget-hint spells out the confirm tap. */
.recipe-forget {
  color: var(--ink-muted);
  opacity: 0.55;
  font-size: 15px;
  padding: 2px 6px;
}
.recipe-forget.armed {
  opacity: 1;
  color: var(--crit);
}
.recipe-forget-hint {
  font-size: 12px;
  color: var(--crit);
}

/* === Picker list rows (loadout's skill / potion pickers) — a tappable row
   shared by renderSkillPickerSheet/renderPotionPickerSheet: icon + name/
   sub-line + optional trailing meta, the .picker-list's generic row
   (.charrow is the world-sheet's own similar but account/character-specific
   row shape). ================================================================ */
.pickrow {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--glass-border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
}
.pickrow .icon-tile {
  width: 30px;
  height: 30px;
  flex: none;
}
.pickrow .pinfo {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.pickrow .pinfo b {
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pickrow .psub {
  font-size: 10.5px;
  color: var(--ink-muted);
}
.pickrow .pmeta {
  flex: none;
  color: var(--accent-strong);
  font-weight: 700;
}
.pickrow.selected {
  border-color: var(--accent);
  background: rgba(201, 162, 75, 0.14);
}
.pickrow.clear {
  justify-content: center;
  color: var(--crit);
  border-color: rgba(207, 91, 84, 0.35);
  margin-bottom: 6px;
}
/* A listed but inert row — e.g. a stack the engine won't trade in the mail /
   private-store bag pickers (#7186): dimmed, no pointer, reason in .psub. */
.pickrow.disabled {
  cursor: default;
  opacity: 0.55;
}
/* .craft-badge is renderRecipeRow's trailing "можно: N" — the same slot
   .pmeta fills elsewhere, muted to --ink-muted when the recipe can't be
   made right now (0), same tint as a disabled row's reason text. */
.craft-badge {
  flex: none;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-strong);
}
.craft-badge.muted {
  color: var(--ink-muted);
  font-weight: 600;
}
.note.danger {
  color: var(--crit);
}

/* === Recipe detail (renderRecipeDetail — the book row's craft screen) ========= */
.recipe-detail {
  display: flex;
  flex-direction: column;
}
.recipe-mats {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* recipe-mat rows open the catalog item-detail sheet (catalog-item-tap) —
   .pickrow's hover/cursor affordance is inherited, just re-asserted here
   since a bare .pickrow.recipe-mat used to opt out of it. */
.pickrow.recipe-mat {
  cursor: pointer;
}
/* icon-tap wraps a plain icon tile (e.g. the recipe product icon) that opens
   the catalog item-detail sheet — reset the button chrome so it reads as
   the tile, not a button. */
.icon-tap {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.mat-count {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.mat-short {
  color: var(--crit);
}
.craft-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.craft-controls [data-action="craft-dec"],
.craft-controls [data-action="craft-inc"] {
  width: 36px;
  min-width: 36px;
  padding: 0;
}
.craft-n {
  min-width: 26px;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* === Item detail sheet (bag cell / paperdoll slot / shop-row tap) — reuses
   .picker ==================================================================== */
.item-sheet-icon {
  width: 64px;
  height: 64px;
  margin: 4px auto 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  font-size: 30px;
}
/* .item-stats is the GET /api/item/details-driven label:value list appended
   to the sheet (see renderItemDetailsSection) — a plain bordered stack of
   rows, spacing/font-size consistent with .pickrow/.picker-note. */
.item-stats {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--glass-border);
  padding-top: 8px;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  font-size: 11.5px;
}
.stat-row span:first-child {
  color: var(--ink-muted);
}
.stat-row span:last-child {
  color: var(--ink);
  font-weight: 600;
  text-align: right;
}
.selgroup .ah {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin: 8px 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.charrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--glass-border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  margin-bottom: 6px;
}
.charrow.active {
  border-color: var(--accent);
  background: rgba(201, 162, 75, 0.14);
}
.charrow.disabled {
  cursor: default;
  opacity: 0.55;
}
/* #7198: the row being entered — gold edge, the shared spinner in place of
   the level. */
.charrow.entering {
  cursor: progress;
  border-color: var(--accent);
  background: rgba(201, 162, 75, 0.1);
}
.charrow .clv .charrow-spin {
  display: block;
  width: 16px;
  height: 16px;
  border-width: 2px;
}
.charrow .cpo {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
}
.charrow .ci {
  flex: 1;
  min-width: 0;
}
.charrow .ci b {
  font-size: 13px;
}
.charrow .ci .cs {
  font-size: 10.5px;
  color: var(--ink-muted);
}
.charrow .clv {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--accent-strong);
  font-size: 13px;
  white-space: nowrap;
}

/* === Tab bar ==================================================================== */
/* Sticky (not merely relative) so the bottom nav stays reachable at all times
   even when a tab's content is taller than the screen and the shell body
   scrolls — the hunt tab's zone list / active-hunt view can grow past the
   fold, and the tabbar must never scroll out of reach. It's the last in-flow
   child of .app, so sticky bottom:0 pins it to the viewport bottom during
   scroll and lands at its natural position at full scroll (nothing is
   permanently hidden behind it). Pre-main screens render no .tabbar, so this
   is scoped to the tabbed main shell only. */
.tabbar {
  flex: 0 0 auto; /* pinned to the bottom of the app shell (never scrolls/shrinks) */
  z-index: 5;
  display: flex;
  padding: 7px 4px calc(9px + env(safe-area-inset-bottom, 0px));
  background: rgba(12, 13, 18, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--glass-border);
}
.tab {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--ink-muted);
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: var(--font-body);
  font-size: 8.5px;
  font-weight: 600;
  padding: 5px 0;
  border-radius: 10px;
  position: relative;
  min-height: 44px;
}
.tab .ti {
  font-size: 17px;
  line-height: 1;
  filter: grayscale(0.6) opacity(0.8);
}
.tab[aria-selected="true"] {
  color: var(--accent-strong);
}
.tab[aria-selected="true"] .ti {
  filter: none;
}

/* === Toast ======================================================================= */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--space-5) + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 14px);
  opacity: 0;
  pointer-events: none;
  z-index: 30;
  background: rgba(11, 12, 16, 0.94);
  color: var(--ink);
  border: 1px solid var(--glass-border);
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 15px;
  border-radius: 11px;
  max-width: 88%;
  text-align: center;
  box-shadow: var(--shadow-soft);
  transition:
    opacity 0.2s,
    transform 0.2s;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.error {
  border-color: rgba(220, 90, 90, 0.55);
  color: #f0c9c9;
}
@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: opacity 1ms linear;
  }
  .progress-fill,
  .bar > i {
    transition: none !important;
  }
}

/* === Expedition progress bar (real accrual) ===================================== */
.progress-fill {
  transition: width 400ms var(--ease);
}

/* === Карьера (profession / class change) card ==================================
   One .prof-row per class-transfer option: a text block (name + tier/level tag
   + cost, plus a reason line when the option is disabled) on the left, the
   "Сменить" button on the right. Reuses the shared .card.glass/.btn tokens; a
   disabled row dims and the reason reads in the --crit (danger) hue. */
.prof-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.prof-row {
  padding: 9px 10px;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}
.prof-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
/* Only the head dims — the quest block below stays readable/tappable, since
   a not-yet-eligible class is exactly when its quest chain matters. */
.prof-row.disabled .prof-head {
  opacity: 0.6;
}
.prof-main {
  flex: 1;
  min-width: 0;
}
.prof-name {
  font-weight: 700;
  font-size: 13px;
}
.prof-tag {
  font-size: 10.5px;
  color: var(--ink-muted);
  margin-top: 1px;
}
.prof-cost {
  font-size: 11.5px;
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
}
.prof-reason {
  font-size: 10.5px;
  color: var(--crit);
  margin-top: 3px;
}
.prof-row .btn.sm {
  flex: 0 0 auto;
}
/* «Квест на профессию» (WS10, renderProfessionQuests): the quest chain into
   this class, one .pickrow.quest-row per quest under a hairline divider. */
.prof-quests {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--glass-border);
}
.prof-quests-lbl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.prof-quest .pinfo b {
  white-space: normal;
}
.prof-quest-hint {
  font-style: italic;
  opacity: 0.8;
}
/* #6976: the alternative route («Или: …») under the chain — dashed, so it
   reads as a second way rather than the chain's next step. */
.prof-quest--alt {
  border-style: dashed;
}
/* Completed quest pill — the existing --ok status token (HP bars), not a new
   accent. */
.pill.ok {
  border-color: var(--ok);
  color: var(--ok);
}

@media (max-width: 360px) {
  .grid-classes {
    grid-template-columns: 1fr;
  }
}

/* === Floating combat FX (auto-hunt pop numbers + loot pops) ==================
   #fx-layer is a fixed, pointer-events:none overlay appended straight to <body>
   (OUTSIDE #app, so render()'s innerHTML rebuild never wipes it — see
   initFxLayer/spawnFloat). Each float is absolutely positioned in viewport
   coordinates by emitCombatFx and removes itself on animationend. Comic/anime
   pop: a quick scale-in bounce, then a rise + fade (~1s). */
#fx-layer {
  position: fixed;
  inset: 0;
  z-index: 40; /* above #app (3) and its z-5 children; pointer-events:none so it never blocks the toast (30) */
  pointer-events: none;
  overflow: hidden;
}

.fx-num,
.fx-loot {
  position: absolute;
  transform: translate(-50%, 0); /* keyframes re-declare transform; this is just the resting anchor */
  will-change: transform, opacity;
  white-space: nowrap;
  user-select: none;
}

/* Damage numbers — bold display serif, tabular so digits don't jitter, gold by
   default with a dark stroke/shadow for the comic pop against any background. */
.fx-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--accent-strong);
  text-shadow:
    0 1px 0 #000,
    0 0 6px rgba(0, 0, 0, 0.85),
    0 0 14px var(--accent-glow);
  -webkit-text-stroke: 0.6px rgba(0, 0, 0, 0.7);
  animation: fx-rise 1s var(--ease) forwards;
}

/* Incoming damage — red (reuses the --crit vital hue). */
.fx-num.taken {
  color: var(--crit);
  text-shadow:
    0 1px 0 #000,
    0 0 6px rgba(0, 0, 0, 0.85),
    0 0 14px rgba(207, 91, 84, 0.6);
}

/* Pseudo-crit — a hit well above the typical: bigger + brighter (white core). */
.fx-num.crit {
  font-size: 32px;
  color: #fff;
  text-shadow:
    0 1px 0 #000,
    0 0 8px rgba(0, 0, 0, 0.9),
    0 0 18px var(--accent-strong);
  -webkit-text-stroke: 0.8px rgba(120, 80, 0, 0.85);
}

/* Item-use pop — same rise as a damage number but smaller and calmer: it
   appears over a button the player just tapped, not over a fight. */
.fx-num.fx-use {
  font-size: 17px;
  font-family: var(--font-body);
  font-weight: 800;
}

/* Loot pop — a small icon tile + gold «+Название» in a rounded glass pill,
   slightly slower/larger than a number. */
.fx-loot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px 4px 4px;
  border: 1px solid var(--accent-glow);
  border-radius: 999px;
  background: rgba(18, 20, 26, 0.72);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.5),
    0 0 12px var(--accent-glow);
  animation: fx-loot-rise 1.25s var(--ease) forwards;
}
.fx-loot .icon-tile {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
}
.fx-loot-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--accent-strong);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes fx-rise {
  0% {
    transform: translate(-50%, 6px) scale(0.6);
    opacity: 0;
  }
  18% {
    transform: translate(-50%, 0) scale(1.15);
    opacity: 1;
  }
  30% {
    transform: translate(-50%, -4px) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -54px) scale(1);
    opacity: 0;
  }
}

@keyframes fx-loot-rise {
  0% {
    transform: translate(-50%, 8px) scale(0.7);
    opacity: 0;
  }
  16% {
    transform: translate(-50%, 0) scale(1.08);
    opacity: 1;
  }
  70% {
    transform: translate(-50%, -22px) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -46px) scale(1);
    opacity: 0;
  }
}

/* Reduced motion: emitCombatFx already skips spawning, but hide the layer too
   as a belt-and-suspenders in case a float ever slips through. */
@media (prefers-reduced-motion: reduce) {
  #fx-layer {
    display: none;
  }
}

/* === Active buff/debuff effect bar (under the xpstrip vitals) =============== */
/* In-game-style square skill-icon tiles: gold border = buff, red = debuff, with
   a tiny remaining-duration badge in the corner. Fed by session.effects. */
.eff-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}
.eff-tile {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  overflow: hidden;
  border: 1.5px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
}
.eff-tile.buff {
  border-color: var(--accent);
  box-shadow: 0 0 6px rgba(201, 162, 75, 0.35);
}
.eff-tile.debuff {
  border-color: var(--crit);
  box-shadow: 0 0 6px rgba(207, 91, 84, 0.4);
}
/* Flatten tileHtml's default .icon-tile chrome so the icon fills the square. */
.eff-tile .icon-tile {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.eff-tile .icon-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.eff-tile {
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
/* Power badge (skill level, or "+N" for an enchanted skill) in the tile's
   top-left corner, opposite .eff-dur. */
.eff-lvl {
  position: absolute;
  left: 0;
  top: 0;
  padding: 1px 2px;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  border-bottom-right-radius: 4px;
  background: rgba(8, 8, 12, 0.82);
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.eff-lvl.ench {
  color: var(--accent-strong);
}

.eff-dur {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 1px 2px;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  border-top-left-radius: 4px;
  background: rgba(8, 8, 12, 0.82);
  color: #fff;
  font-variant-numeric: tabular-nums;
}

/* === Soulshot/spiritshot indicator on the hunt screen ====================== */
/* Gold "заряды активны" while shots are charging; flips red "закончились" the
   moment they run out (hidden entirely if the weapon doesn't use shots). */
.shots-row {
  display: flex;
  flex-wrap: nowrap; /* #6817: soulshots and spiritshots share one line */
  gap: 6px;
  margin-top: 10px;
  min-width: 0;
}
.shots-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex: 0 1 auto;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid var(--glass-border);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.shots-badge .sb-lbl {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shots-badge .sb-ic {
  font-size: 12px;
  line-height: 1;
}
.shots-badge.on {
  color: var(--accent-strong);
  border-color: var(--accent);
  background: rgba(201, 162, 75, 0.1);
  box-shadow: 0 0 8px var(--accent-glow);
}
.shots-badge.off {
  color: var(--crit);
  border-color: var(--crit);
  background: rgba(207, 91, 84, 0.12);
}

/* === Hunt action / skill history — one large centered "current action" tile
   (active cast or persistent auto-attack) plus a small stacked strip of recent
   skill casts underneath. Built to feel lively without changing the card's
   overall height every poll. ================================================ */
.skill-cast {
  margin-top: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.sc-active-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 56px;
}
.sc-active {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02) 58%),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(201, 162, 75, 0.28);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: visible;
  transform-origin: center;
}
.sc-active .icon-tile {
  width: 100%;
  height: 100%;
  border-radius: 15px;
  overflow: hidden;
  background: transparent;
}
.sc-active .icon-tile img {
  width: 88%;
  height: 88%;
}
.sc-active.attacking {
  border-color: rgba(201, 162, 75, 0.2);
}
.sc-active.attacking .icon-tile {
  color: var(--accent-strong);
  font-size: 26px;
  text-shadow:
    0 0 10px rgba(201, 162, 75, 0.22),
    0 2px 6px rgba(0, 0, 0, 0.45);
}
.sc-active.casting {
  border-color: var(--accent);
  box-shadow:
    0 0 18px rgba(201, 162, 75, 0.22),
    0 8px 22px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.sc-active.casting.just-started {
  animation: sc-cast-pop 220ms ease-out;
}
.sc-active.beat {
  animation: sc-attack-beat 220ms ease-out;
}
.skill-cast-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 28px;
  overflow: hidden;
  padding: 0 10px;
}
.skill-cast-bar.empty {
  visibility: hidden;
}
.sc-hist-item {
  position: relative;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin-left: -6px;
  border-radius: 8px;
  opacity: 0.55;
  transform-origin: center bottom;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.sc-hist-item:first-child {
  margin-left: 0;
}
.sc-hist-item .icon-tile {
  width: 100%;
  height: 100%;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.16);
}
.sc-hist-item .icon-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sc-hist-item.d3 {
  opacity: 0.34;
  transform: translateY(2px) scale(0.86);
}
.sc-hist-item.d2 {
  opacity: 0.42;
  transform: translateY(2px) scale(0.9);
}
.sc-hist-item.d1 {
  opacity: 0.5;
  transform: translateY(1px) scale(0.95);
}
.sc-hist-item.d0 {
  opacity: 0.72;
  transform: translateY(0) scale(1);
}
.sc-hist-item.latest {
  animation: sc-history-in 260ms ease-out;
}
/* Cooldown wash: the tile is dimmed and a dark curtain covers the fraction of
   the engine's reuse delay still running (CombatEvent.reuse_ms + at_ms, see
   castCooldownPct in app.js). --sc-cd is that fraction, 0-100%. It is a static
   height per render, not an animation: the value is re-derived on every
   repaint, so the curtain falls as the hunt screen redraws. */
.sc-hist-item.cooling .icon-tile {
  filter: grayscale(0.55) brightness(0.7);
}
.sc-hist-item .sc-cd {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: var(--sc-cd, 0%);
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, rgba(8, 10, 14, 0.72), rgba(8, 10, 14, 0.42));
  border-bottom: 1px solid rgba(201, 162, 75, 0.45);
  pointer-events: none;
}
/* Sweeping cast-progress ring (present only on the casting tile). */
.sc-ring {
  position: absolute;
  inset: -5px;
  pointer-events: none;
}
.sc-ring rect {
  fill: none;
  stroke-width: 2.5;
}
.sc-ring-bg {
  stroke: rgba(255, 255, 255, 0.1);
}
.sc-ring-fg {
  stroke: var(--accent-strong);
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: sc-cast var(--sc-cast-ms, 2000ms) linear 1 forwards;
  animation-delay: var(--sc-cast-delay, 0ms);
  filter: drop-shadow(0 0 3px var(--accent-glow));
}
@keyframes sc-cast {
  from {
    stroke-dashoffset: 100;
  }
  to {
    stroke-dashoffset: 0;
  }
}
.sc-caption {
  max-width: 100%;
  min-height: 14px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-strong);
  line-height: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sc-attack-flare {
  position: absolute;
  inset: -2px;
  border-radius: 16px;
  border: 1px solid rgba(255, 214, 122, 0.45);
  box-shadow:
    0 0 18px rgba(255, 214, 122, 0.18),
    inset 0 0 12px rgba(255, 214, 122, 0.12);
  opacity: 0;
  animation: sc-attack-flare 220ms ease-out;
  pointer-events: none;
}
.sc-glyph {
  font-size: 1.35rem;
}
/* Instant application (cast_ms === 0: session buffs, the on-death auto-sweep).
   These never pass through the engine's doCast, so there is no duration to
   sweep — a single outward gold pulse, deliberately unlike the casting tile's
   steady ring, is the whole tell. */
.sc-instant-pop {
  position: absolute;
  inset: -4px;
  border-radius: 18px;
  border: 1px solid var(--accent);
  box-shadow:
    0 0 20px rgba(201, 162, 75, 0.3),
    inset 0 0 14px rgba(201, 162, 75, 0.16);
  opacity: 0;
  animation: sc-instant-pop 320ms ease-out;
  pointer-events: none;
}
@keyframes sc-instant-pop {
  0% {
    opacity: 0.9;
    transform: scale(0.82);
  }
  100% {
    opacity: 0;
    transform: scale(1.24);
  }
}
@keyframes sc-cast-pop {
  from {
    transform: translateY(6px) scale(0.86);
    opacity: 0.1;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}
@keyframes sc-history-in {
  from {
    transform: translateY(8px) scale(0.72);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 0.72;
  }
}
@keyframes sc-attack-beat {
  0% {
    transform: scale(0.95);
  }
  50% {
    transform: scale(1.07);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes sc-attack-flare {
  0% {
    opacity: 0.7;
    transform: scale(0.88);
  }
  100% {
    opacity: 0;
    transform: scale(1.18);
  }
}
@media (prefers-reduced-motion: reduce) {
  .sc-ring-fg {
    animation: none;
    stroke-dashoffset: 0;
  }
  .sc-active.casting,
  .sc-active.beat,
  .sc-hist-item.latest,
  .sc-instant-pop,
  .sc-attack-flare {
    animation: none;
  }
}

/* === Connection-lost overlay (blocks the whole app while offline) =========== */
/* Fixed full-screen scrim above everything (sheets are z ~40-90); pointer-events
   default (auto) so it swallows every tap until the server is reachable again. */
#conn-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 8, 14, 0.74);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
#conn-overlay.shown {
  display: flex;
}
.conn-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  padding: 24px 28px;
  text-align: center;
}
.conn-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}
.conn-sub {
  font-size: 12px;
  color: var(--ink-muted);
}

/* === Задания (quests, WS6, docs/plans/2026-09-22-quests.md) ==================== */
/* .quest-row reuses .pickrow (icon + .pinfo + trailing badge) wholesale — see
   renderQuestCatalogRow/renderQuestActiveRow; --dim is the only addition,
   for a quest the character can't currently take (D5: shown, not hidden). */
.quest-row--dim {
  opacity: 0.55;
}
/* === Quest page (tracker #6749/#6758/#6750): «Выполнение» / «Описание» ======= */
/* Status line: one dot + phase + a short tail («● ОХОТА · Волчья Шкура 23/40»). */
.quest-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.quest-status b {
  font-weight: 700;
  color: var(--ink);
}
.quest-status .qs-detail {
  text-transform: none;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.quest-status .qs-detail::before {
  content: "·";
  margin-right: 8px;
  color: var(--ink-muted);
}
.qs-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--ink-muted);
}
.quest-status--on .qs-dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.quest-status--on b,
.quest-status--ready b {
  color: var(--accent-strong);
}
.quest-status--ready .qs-dot {
  background: var(--accent-strong);
  box-shadow: 0 0 10px var(--accent-glow);
}
.quest-status--ok .qs-dot {
  background: var(--ok);
}
.quest-status--ok b {
  color: var(--ok);
}
.quest-note,
.quest-hint {
  margin-top: 0;
  text-align: left;
}
.quest-hint--warn {
  color: var(--warn);
}
/* Quest page bottom bar (#6773): «Назад» + «Отказаться» — in the normal flow
   at the very end of the content (#7145: no longer sticky; pinned, it covered
   the steps and invited mis-taps). */
.screen.quest-page {
  overflow: visible;
  padding-bottom: 0;
}
.quest-bar {
  /* #6810: a floating Forge-Glass panel (the .glass recipe), not a solid slab
     glued onto the tabbar — the page shows through, the two bars read as two. */
  display: flex;
  gap: 10px;
  margin: 16px 0 8px;
  padding: 8px;
  border-radius: 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(120%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(120%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  /* The viewport ends above the tabbar, which pads for the home indicator;
     landscape notches still get their side insets. */
  padding-left: max(8px, env(safe-area-inset-left, 0px));
  padding-right: max(8px, env(safe-area-inset-right, 0px));
}
.quest-bar .btn {
  flex: 1 1 0;
  min-width: 0;
}

/* In-page confirmation (confirm() is dead in the Telegram WebView). */
.qconfirm {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(6, 7, 10, 0.62);
  animation: qconfirm-in 0.18s var(--ease) both;
}
.qconfirm {
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.qconfirm-card {
  /* denser than plain .glass: the quest text behind must not read through */
  background: rgba(16, 18, 24, 0.94);
  width: 100%;
  max-width: 360px;
  border-radius: 16px;
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qconfirm-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.35;
  color: var(--ink);
}
.qconfirm-card .note {
  margin-top: 0;
  text-align: left;
}
.qconfirm-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.qconfirm-actions .btn {
  flex: 1 1 0;
  min-width: 0;
}
@keyframes qconfirm-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.quest-sec {
  margin-bottom: -4px;
}
.quest-text {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-muted);
  white-space: pre-line;
}
.quest-reason .note {
  margin-top: 0;
}

/* The stage slot: the travel card while running, the NPC's words after the
   arrival. One min-height for both so the swap does not move the page. */
.quest-stage {
  min-height: 112px;
  display: flex;
  flex-direction: column;
}
.quest-stage > * {
  flex: 1 1 auto;
}

/* Travel card (#6758): route line, percent, runner marker, leg segments. */
.quest-travel {
  padding: 13px 15px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.qt-route {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  min-width: 0;
}
.qt-from {
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.qt-arrow {
  color: var(--accent);
  flex: none;
}
.qt-to {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.qt-to-title {
  color: var(--ink-muted);
  font-weight: 400;
}
.qt-pct {
  margin-left: auto;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  color: var(--accent-strong);
}
.qt-track {
  position: relative;
  padding-top: 14px;
}
.qt-bar,
.qt-seg-bar {
  display: block;
  height: 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.qt-bar > i,
.qt-seg-bar > i {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  box-shadow: 0 0 10px var(--accent-glow);
  transition: width 0.9s linear;
}
.qt-segs {
  display: flex;
  gap: 4px;
}
.qt-seg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 22px;
}
.qt-seg .qt-seg-bar {
  width: 100%;
}
.qt-seg-ico {
  font-size: 11px;
  line-height: 1;
  opacity: 0.45;
}
.qt-seg.done .qt-seg-ico {
  opacity: 0.7;
}
.qt-seg.cur .qt-seg-ico {
  opacity: 1;
}
.qt-seg.cur .qt-seg-bar {
  outline: 1px solid rgba(201, 162, 75, 0.55);
  outline-offset: 1px;
}
.qt-runner {
  position: absolute;
  top: -2px;
  transform: translateX(-50%);
  font-size: 14px;
  line-height: 1;
  transition: left 0.9s linear;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}
.qt-leg {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink);
  margin-top: -4px;
}
.qt-leg-n {
  color: var(--ink-muted);
}
/* #7214: a paused run's card, frozen where the character stopped. */
.quest-travel--paused .qt-bar > i,
.quest-travel--paused .qt-seg-bar > i {
  background: var(--ink-muted);
  box-shadow: none;
}
.quest-travel--paused .qt-pct,
.quest-travel--paused .qt-leg {
  color: var(--ink-muted);
}

/* The NPC's words: one dialog bubble with the (RU) NPC name. */
.quest-said {
  border-left: 3px solid var(--accent);
  border-radius: 4px var(--radius-panel) var(--radius-panel) var(--radius-panel);
  padding: 11px 14px 12px;
}
.qsd-who {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-strong);
}
.qsd-text {
  margin-top: 5px;
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre-line;
  max-height: 11.5em;
  overflow-y: auto;
}

/* «Сейчас»: the current sub-task — a visit checklist or the hunt counters. */
.quest-now {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quest-check {
  display: flex;
  flex-direction: column;
}
.qc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.qc-row:first-child {
  border-top: 0;
}
.qc-mark {
  width: 18px;
  flex: none;
  text-align: center;
  color: var(--ink-muted);
}
.qc-row.done .qc-mark {
  color: var(--ok);
}
.qc-row.next .qc-mark {
  color: var(--accent-strong);
}
.qc-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  font-size: 13px;
}
.qc-row.done .qc-body b {
  color: var(--ink-muted);
  font-weight: 500;
}
.qc-sub {
  font-size: 11px;
  color: var(--ink-muted);
}
.qc-go {
  flex: none;
}
.qn-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-strong);
  margin-top: -2px;
}
.qn-desc {
  margin-top: -4px;
}
/* #7244: why the character goes — the summary line, then the NPC's words
   folded under «Что сказал NPC». */
.qn-why {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: -2px;
}
.qn-summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  background: rgba(201, 162, 75, 0.07);
}
.qn-summary-lbl {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-strong);
}
.qn-summary-text {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
}
.qn-said-toggle {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--ink-muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.qn-said-toggle:hover,
.qn-said-toggle[aria-expanded='true'] {
  color: var(--accent-strong);
}
.qn-said-caret {
  width: 10px;
  text-align: center;
}
.qn-said-who {
  color: var(--ink-muted);
}
.qh-line {
  display: flex;
  gap: 10px;
  font-size: 12.5px;
}
.qh-line .lbl {
  width: 38px;
  flex: none;
  padding-top: 1px;
}
.qg-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.qg-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
}
.qg-head .icon-tile {
  width: 20px;
  height: 20px;
  flex: none;
}
.qg-name {
  flex: 1 1 auto;
  min-width: 0;
}
.qg-row.met .num {
  color: var(--ok);
}

/* «Описание»: the journal of completed steps (✓ only, like the in-game one). */
.quest-journal {
  display: flex;
  flex-direction: column;
  padding-top: 6px;
  padding-bottom: 6px;
}
.qj-step {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.qj-step:first-child {
  border-top: 0;
}
.qj-mark {
  width: 16px;
  flex: none;
  text-align: center;
  color: var(--ink-muted);
  padding-top: 1px;
}
.qj-body {
  flex: 1 1 auto;
  min-width: 0;
}
.qj-title {
  font-size: 13px;
  font-weight: 600;
}
.qj-goals {
  margin-top: 8px;
}
.qj-step--done .qj-mark {
  color: var(--ok);
}
.qj-step--done .qj-title {
  color: var(--ink-muted);
}

/* Rewards (#6750): plain row, «одна из:», «для воинов / для магов», and what
   NPCs hand out along the way. */
.qr-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
}
.qr-group:first-child {
  margin-top: 0;
}
.qr-lbl {
  font-size: 11px;
  color: var(--ink-muted);
}
.qr-way-lbl {
  margin-top: 12px;
  font-size: 11px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.qr-way {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.qr-npc {
  font-size: 12px;
  color: var(--ink);
}
.quest-reason .note::first-letter {
  text-transform: uppercase;
}

/* Bag gate (#6783): the quest-dialog weight/slot gate shown up front on the
   Задания list, the quest page and a quest hunt — warn tint at >= 75 %, crit
   at the gate or on the server's own refusal, with the way to the Инвентарь. */
.bag-gate {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 9px 10px 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(230, 193, 115, 0.35);
  background: rgba(230, 193, 115, 0.07);
}
.bag-gate.crit {
  border-color: rgba(207, 91, 84, 0.45);
  background: rgba(207, 91, 84, 0.09);
}
.bag-gate .bg-ico {
  font-size: 18px;
  line-height: 1;
  flex: 0 0 auto;
}
.bag-gate .bg-txt {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bag-gate .bg-txt b {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--warn);
  line-height: 1.3;
}
.bag-gate.crit .bg-txt b {
  color: var(--crit);
}
.bag-gate .bg-txt span {
  font-size: 11.5px;
  color: var(--ink-muted);
  line-height: 1.3;
}
.bag-gate .btn {
  flex: 0 0 auto;
}
.bag-gate-back {
  align-self: flex-start;
  margin-bottom: 4px;
  padding-left: 0;
}

/* ---- Hunt screen: quest tracker + counter pop (#6776, #6802) ---------- */
.hq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.hq {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px 10px;
  border-radius: 12px;
}
.hq--met {
  border-color: rgba(201, 162, 75, 0.45);
}
.hq-head {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.hq-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hq-go {
  color: var(--ink-muted);
}
.hq-goal {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  column-gap: 7px;
  row-gap: 4px;
  font-size: 12.5px;
}
.hq-goal .icon-tile {
  width: 20px;
  height: 20px;
}
.hq-goal .hq-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hq-goal .hq-bar {
  grid-column: 1 / -1;
}
.hq-goal.met .num {
  color: var(--ok);
}
.hq-kill {
  width: 20px;
  text-align: center;
  font-size: 13px;
}
.hq-done {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--glass-border);
  font-size: 12px;
}
.hq-done b {
  color: var(--accent);
  font-weight: 600;
}
.hq-done span {
  color: var(--ink-muted);
}
.hq-done .btn {
  margin-top: 4px;
}
.quest-pop {
  position: fixed;
  z-index: 30;
  /* centred without left:50% (that halves the shrink-to-fit width and
     wrapped «40/40 ✓» onto two lines) */
  left: 0;
  right: 0;
  margin-inline: auto;
  width: max-content;
  top: calc(env(safe-area-inset-top, 0px) + 118px);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 32px);
  padding: 8px 14px 8px 10px;
  border-radius: 12px;
  border-color: rgba(201, 162, 75, 0.45);
  font-size: 13px;
  pointer-events: none;
  animation: quest-pop-in 2.6s var(--ease, ease) both;
}
.quest-pop .icon-tile {
  width: 26px;
  height: 26px;
}
.quest-pop .qp-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quest-pop .num {
  color: var(--accent);
}
.quest-pop--met .num {
  color: var(--ok);
}
@keyframes quest-pop-in {
  0% { opacity: 0; transform: translateY(-6px) scale(0.96); }
  8% { opacity: 1; transform: translateY(0) scale(1); }
  82% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-4px) scale(0.98); }
}
.quest-pop .num {
  white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  .quest-pop { animation: none; }
}

/* ---- Quest page: «Получено» — the engine's measured payout (#6784) ---- */
.quest-received .qr-npc {
  display: block;
  margin: 2px 0 6px;
  font-size: 12px;
  color: var(--ink-muted);
}
.quest-received .num {
  color: var(--accent-strong);
}
.chip.chip--taken {
  opacity: 0.62;
}
.hq-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.hq-toggle-lbl {
  flex: none;
  font-weight: 700;
  color: var(--accent);
}
.hq-toggle-sum {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-muted);
}
.hq-toggle-caret {
  flex: none;
  color: var(--ink-muted);
}
.qfinish-list {
  margin: 6px 0 8px;
  padding-left: 18px;
  font-size: 13px;
}

/* ---- Quest page: k-of-n sub-task picker (#6796) ---------------------- */
.quest-kofn {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.qk-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
.qk-head .num {
  color: var(--accent);
  font-weight: 700;
}
.qk-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px solid var(--glass-border);
}
.qk-row .icon-tile {
  width: 28px;
  height: 28px;
}
.qk-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  font-size: 12.5px;
}
.qk-body .qc-sub {
  overflow: hidden;
  text-overflow: ellipsis;
}
.qk-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}
.qk-row.off {
  opacity: 0.55;
}
.qk-row.done .qk-body b {
  color: var(--ok);
}

/* ---- Quest page: silent hunt requirements (#6788) --------------------- */
.quest-reqs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 8px;
}
.qreq {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  font-size: 12.5px;
}
.qreq > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.qreq span {
  color: var(--ink-muted);
  font-size: 12px;
}
.qreq.ok {
  color: var(--ok);
}
.qreq.warn {
  border-color: rgba(230, 193, 115, 0.4);
  background: rgba(230, 193, 115, 0.07);
}
.qreq.warn b {
  color: var(--warn);
  font-weight: 600;
}
.qreq-miss {
  flex: none;
}
.qreq-note {
  margin: 2px 2px 0;
}

/* ---- Hunt start refused by a quest requirement (#6894) ---------------- */
.hunt-refusal {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(230, 193, 115, 0.45);
}
.hunt-refusal b {
  color: var(--warn);
  font-weight: 600;
  font-size: 13px;
}
.hunt-refusal span {
  color: var(--ink-muted);
  font-size: 12.5px;
}
.hunt-refusal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

/* ---- A world restarting under the open session (#6781) ---------------- */
.world-restart {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(6, 7, 10, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.world-restart-card {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-radius: 18px;
  text-align: center;
}
.world-restart-card .wr-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.world-restart-card .note .num {
  color: var(--accent);
}

/* Hunt target: the client's level-difference colour + «ур. N» (#6819). */
.hunt-target .ht-name {
  font-weight: 700;
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.9), 0 1px 2px rgba(0, 0, 0, 0.8);
}
.hunt-target .ht-lvl {
  color: var(--ink-muted);
  font-weight: 600;
}

/* ---- «Задания» badge (#6795) ----------------------------------------- */
.tab .ti {
  position: relative;
}
.tab-badge {
  position: absolute;
  top: -6px;
  right: -12px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #1a1408;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  filter: none;
  box-shadow: 0 0 6px var(--accent-glow);
}
.quest-rec {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quest-rec .lbl {
  margin: 0;
}

/* ---- Inventory: the quest-items tab (#6924) ---------------------------- */
.inv-quest-note {
  margin: 4px 2px 8px;
}

/* ---- Character busy state on the select lists (#6917 / #6925) ---------- */
.cbusy {
  display: inline-block;
  margin-top: 3px;
  font-size: 10.5px;
  line-height: 1.3;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  color: var(--ink-muted);
}
.cbusy--hunt,
.cbusy--client,
.cbusy--trade {
  color: var(--accent-strong);
  border-color: var(--accent-glow);
  background: rgba(201, 162, 75, 0.12);
}
.cbusy--client {
  color: var(--warn);
  border-color: rgba(230, 193, 115, 0.45);
  background: rgba(230, 193, 115, 0.08);
}
.charrow .ci .cbusy {
  display: table;
}
.inworld {
  font-size: 12px;
  color: var(--ink-muted);
  padding: 2px 2px 8px;
}
.inworld b {
  color: var(--ink);
  font-weight: 600;
}
.cswitch-actions {
  flex-direction: column;
  align-items: stretch;
}

/* ---- Active accounts indicator (#6809) ---------------------------------- */
.acc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 55vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  color: var(--ink-muted);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
}
.acc-chip .dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}
.acc-count {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: 4px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  color: #1a1408;
  background: var(--accent);
}

/* ---- Login screen tabs (#6808) ------------------------------------------ */
.login-tabs {
  margin: 0 0 10px;
}
.login-tabs .cnt {
  font-size: 10.5px;
  opacity: 0.75;
  margin-left: 3px;
}
.charrow .ci b,
.charrow .ci .cs {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Карьера: the profession-quest mark path (#6947) --------------------- */
.prof-marks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--glass-border);
}
.prof-mark {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}
.prof-mark .icon-tile {
  width: 28px;
  height: 28px;
  flex: none;
}
.prof-mark .pm-name {
  flex: 1;
  min-width: 0;
}
.prof-mark .num {
  color: var(--ink-muted);
}
.prof-mark.ok .num {
  color: var(--ok);
}
.prof-bymark {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.prof-bymark .pm-for {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}
.prof-bymark .pm-for .icon-tile {
  width: 20px;
  height: 20px;
}
.prof-confirm {
  margin-top: 4px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--accent-glow);
  background: rgba(201, 162, 75, 0.07);
}
.head > .badge {
  align-self: flex-start;
}

/* ---- «Изучить» (#6919) --------------------------------------------------- */
.tab-badge.inline {
  position: static;
  display: inline-block;
  margin-left: 4px;
  vertical-align: 1px;
}
.skills-seg {
  margin-bottom: 10px;
}
.learn-note {
  margin: 0 2px 8px;
}
.learn-sp {
  margin: 0 2px 10px;
}
.learnrow {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--glass-border);
}
.learnrow:last-child {
  border-bottom: 0;
}
.learnrow > .icon-tile {
  width: 34px;
  height: 34px;
  flex: none;
}
.learnrow.upcoming {
  opacity: 0.7;
}
.lr-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lr-main b {
  font-size: 13px;
  font-weight: 600;
}
.lr-meta {
  font-size: 11.5px;
  color: var(--ink-muted);
}
.lr-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 3px;
}
.lr-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--ink-muted);
}
.lr-item .icon-tile {
  width: 20px;
  height: 20px;
}
.lr-item b {
  color: var(--crit);
}
.lr-item.ok b {
  color: var(--ok);
}
.lr-reason {
  font-size: 11px;
  color: var(--warn);
}
.lr-when {
  flex: none;
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
  padding-top: 8px;
}
.learnrow .btn.sm {
  flex: none;
  align-self: center;
}

/* ---- «Задания» marks on the rows (#6915) --------------------------------- */
.quest-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  vertical-align: 2px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.quest-why {
  display: inline-block;
  align-self: flex-start;
  margin-top: 3px;
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 999px;
  color: var(--accent-strong);
  border: 1px solid var(--accent-glow);
  background: rgba(201, 162, 75, 0.1);
}

/* ---- Settings (#6877): the gear in the app bar + the sheet --------------- */
.gear-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  color: var(--ink-muted);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  cursor: pointer;
}
.gear-btn:hover,
.gear-btn:focus-visible {
  color: var(--accent-strong);
  border-color: var(--accent-glow);
}
.xpstrip .xp-adena {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}
.set-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}
.set-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.set-mute.active {
  color: var(--accent-strong);
  border-color: var(--accent-glow);
}
.set-row-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 4px;
}
.set-row-head b {
  color: var(--accent-strong);
  min-width: 2.5em;
  text-align: right;
}
.set-range {
  width: 100%;
  accent-color: var(--accent);
  height: 24px;
}
.set-range:disabled {
  opacity: 0.4;
}
.set-note {
  font-size: 11.5px;
}
.set-bg-row > span {
  font-size: 13px; /* the slider rows' label size (#7066) */
}
/* #6947 refinement: the class change sits on the completed quest's row. */
.prof-markrow {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--accent-glow);
  background: rgba(201, 162, 75, 0.06);
}
.prof-markrow-act {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px 2px;
  font-size: 12.5px;
}
.prof-markrow-act .icon-tile {
  width: 24px;
  height: 24px;
  flex: none;
}
.prof-markrow-act .pm-name {
  flex: 1;
  min-width: 0;
  color: var(--ink-muted);
}
.quest-unavail {
  margin-top: 8px;
}

/* ---- repeatable collect quests (#6939): the collect loop's card --------- */
.quest-repeat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.qr-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
}
.qr-item .icon-tile {
  width: 20px;
  height: 20px;
  flex: none;
}
.qr-name {
  flex: 1 1 auto;
  min-width: 0;
}
.qr-goal {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
}
.qr-target {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.qr-target .lbl {
  flex: none;
}
.qr-input {
  width: 6.5em;
  max-width: 100%;
  flex: none;
}
.qr-target .note {
  flex: 1 1 8em;
  min-width: 0;
}
.qr-due {
  display: flex;
}
.qr-sell .icon-tile {
  width: 18px;
  height: 18px;
  vertical-align: -4px;
  margin-right: 4px;
}
.quest-career-go.prof-bymark {
  margin-top: 10px;
}

/* ---- forced fight of a dialog-spawned monster (#6887) ------------------- */
.quest-forced {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  border-color: rgba(207, 91, 84, 0.45);
  box-shadow: 0 0 18px rgba(207, 91, 84, 0.12);
}
.quest-forced--lost {
  border-color: var(--glass-border);
  box-shadow: none;
}
.qf-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-strong);
}
.qf-left {
  color: var(--warn);
}
.qf-hunt {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.qf-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}
.qf-line .lbl {
  width: 44px;
  flex: none;
}
.qf-line .bar {
  flex: 1 1 auto;
  min-width: 0;
}
.qf-hp > i {
  background: var(--hp);
}
.qf-thp > i {
  background: linear-gradient(90deg, #b5514c, #cf5b54);
}
.qf-target {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Карьера: the option a «Знак получен — смените профессию» link lands on. */
.prof-row--focus {
  border-color: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

/* ---- quest runner states (#7015): spawned NPCs, zone switch, no route --- */
.quest-spawn-talk .qt-arrow {
  font-size: 15px;
}
.qsp-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.qsp-line .note {
  margin: 0;
}
.qsp-left {
  color: var(--warn);
  font-size: 12.5px;
  white-space: nowrap;
}
.qsp-left--soon {
  color: var(--crit);
  font-weight: 700;
}
.quest-spawns,
.quest-zone-switch {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.quest-spawns .lbl {
  margin: 0;
}
.qsp-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  min-width: 0;
}
.qsp-row b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quest-zone-switch {
  border-color: rgba(201, 162, 75, 0.45);
}
.qz-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent-strong);
}
.quest-spawn-lost .btn,
.quest-zone-switch .btn {
  margin-top: 2px;
}
.qg-zone {
  display: block;
  font-size: 11px;
  color: var(--ink-muted);
}
.qg-zone.cur {
  color: var(--accent);
}

/* «Сохранённые»: a held account's row (#7019) — login + «кто в мире» on the
   full width, badges and «Выйти из игры» on a second line. */
.charrow--held {
  flex-wrap: wrap;
  row-gap: 7px;
}
.charrow--held .ci {
  flex: 1 1 100%;
}
.charrow.charrow--held .ci .cs {
  white-space: normal;
  overflow-wrap: anywhere;
}
.acc-side {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.acc-side .btn {
  margin-left: auto;
}

/* === «История охот» (#6842) ====================================================
   The hunt screen's head row carries the entry button next to the title; the
   history list reuses .pickrow, the detail the .statgrid and the loot tiles
   (as buttons: each opens the read-only item sheet). */
.hunt-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.hunt-head-row .btn {
  flex: none;
}
.pickrow.hunt-rec {
  align-items: flex-start;
}
.pickrow.hunt-rec .pinfo b {
  font-size: 13.5px;
}
.hunt-rec-gains {
  margin-top: 3px;
  font-size: 11px;
  color: var(--ink);
  line-height: 1.4;
}
.pickrow.hunt-rec .pill {
  flex: none;
  margin-top: 1px;
}
.hunt-rec-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.hunt-rec-drops {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
  gap: 8px 6px;
}
.hunt-rec-drops .loot-cell {
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

/* ==== Рынок → Игроки: players' private stores (ADR-0027) ===================== */
.market-top {
  margin-bottom: 2px;
}
.my-store-entry .pill {
  flex: none;
}
.store-away {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 13px;
  border-radius: 12px;
  font-size: 12px;
  color: var(--ink-muted);
}
.store-away .btn {
  align-self: flex-start;
}
.store-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.store-mode--sell,
.store-mode--package_sell {
  color: var(--accent-strong);
  border-color: var(--accent-glow);
}
.store-mode--buy {
  color: var(--mp);
  border-color: rgba(92, 134, 192, 0.5);
}
.store-mode--manufacture {
  color: var(--warn);
  border-color: rgba(230, 193, 115, 0.45);
}
.store-line {
  cursor: default;
  flex-wrap: wrap;
}
.store-line .pinfo {
  min-width: 120px;
}
.store-mats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--ink-muted);
}
.store-mat.lack {
  color: var(--crit);
}
.store-notice.crit b {
  color: var(--crit);
}
.store-travel-what {
  margin-top: -4px;
}
.store-status {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.store-status-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
}
.store-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.store-kpis > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.store-kpis b {
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.store-done {
  font-size: 10.5px;
  font-weight: 700;
}
.store-actions {
  gap: 8px;
}
.store-last {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.store-editor-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
}
.store-modes button {
  font-size: 11px;
  padding: 8px 2px;
}
.store-draft-meta {
  margin-top: -2px;
}
.store-draft-line {
  cursor: default;
  align-items: flex-start;
}
.store-draft-line .pinfo b {
  white-space: normal;
}
.store-draft-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 6px;
}
.store-draft-inputs label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--ink-muted);
}
.qty-input.store-price {
  width: 78px;
}
/* A draft line / recipe without a valid price (#7038): the store can't open
   until the owner types one. */
.store-draft-line.needs-price {
  border-color: rgba(207, 91, 84, 0.45);
}
.store-price-field.needs-price .qty-input.store-price {
  border-color: var(--crit);
}
.store-price-missing {
  align-self: center;
  font-size: 10.5px;
  color: var(--crit);
}
.store-line-remove,
.store-recipe-toggle {
  color: var(--ink-muted);
  font-size: 15px;
  padding: 4px 6px;
}
.store-recipe-toggle[aria-pressed="true"] {
  color: var(--accent-strong);
}
.store-hunt-line {
  margin-top: 6px;
  text-align: center;
  color: var(--warn);
}
.store-reopen b {
  color: var(--accent-strong);
}

/* ---- «Сначала выполните «…»» (#6977): the prerequisite line ------------- */
/* Under an unavailable quest row (a row is a button, so the link is its own
   button), in the quest page's reason card, and in a take refusal. */
.quest-row-wrap {
  display: flex;
  flex-direction: column;
}
.quest-row-wrap .quest-row {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.quest-prereq-link {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 8px;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--glass-border);
  border-radius: 11px;
  background: rgba(201, 162, 75, 0.07);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.quest-row-wrap .quest-prereq-link {
  border-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
.quest-prereq-link .qpl-text {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
}
.quest-prereq-link .qpl-sub,
.quest-reason .qpl-sub {
  font-size: 10.5px;
  color: var(--ink-muted);
}
.quest-prereq-link .qpl-go {
  margin-left: auto;
  color: var(--accent);
}
.quest-reason .quest-prereq-link {
  margin: 0;
}

/* ---- «Семь Печатей» under «Задания» (#6839) ------------------------------ */
/* Dawn wears the gold accent, Dusk the cool MP blue (a game-semantic token,
   not a second accent). */
.signs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.signs .card {
  margin: 0;
}
.signs-dawn { --side: var(--accent); }
.signs-dusk { --side: var(--mp); }
.signs-period-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.signs-period-head b {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--ink);
}
.signs-scores-row {
  display: flex;
  gap: 10px;
}
.signs-side-score {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.signs-side-score + .signs-side-score {
  text-align: right;
}
.signs-side-score .ss-name {
  font-size: 12px;
  color: var(--side);
  font-weight: 600;
}
.signs-side-score b {
  font-size: 18px;
}
.signs-side-score.lead b {
  color: var(--side);
}
.signs-side-score .ss-sub {
  font-size: 10.5px;
  color: var(--ink-muted);
}
.signs-bar {
  display: flex;
  height: 6px;
  margin: 8px 0 6px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}
.signs-bar i {
  display: block;
  height: 100%;
}
.signs-bar-dawn { background: var(--accent); }
.signs-bar-dusk { background: var(--mp); }
.signs-seal {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--glass-border);
  font-size: 12.5px;
}
.signs-seals .lbl + .signs-seal {
  border-top: 0;
}
.signs-seal .sl-name {
  flex: 1 1 auto;
  min-width: 0;
}
.signs-seal .sl-owner {
  color: var(--ink-muted);
  font-size: 12px;
}
.signs-seal .sl-owner.signs-dawn,
.signs-seal .sl-owner.signs-dusk {
  color: var(--side);
  font-weight: 600;
}
.signs-seal .sl-votes {
  min-width: 52px;
  text-align: right;
  color: var(--ink-muted);
  font-size: 11px;
}
.signs-mine {
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-color: color-mix(in srgb, var(--side) 45%, transparent);
}
.signs-mine > b {
  color: var(--side);
  font-size: 15px;
}
.signs-contrib {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-muted);
}
.signs-contrib b {
  color: var(--ink);
}
.signs-sides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0 10px;
}
.signs-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--ink);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
}
.signs-side.picked {
  border-color: var(--side);
  box-shadow: 0 0 0 1px var(--side) inset;
}
.signs-side.off {
  opacity: 0.6;
  cursor: default;
}
.signs-side .sd-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
}
.signs-side .sd-glyph {
  color: var(--side);
  font-size: 15px;
}
.signs-side .sd-reason,
.signs-side .sd-priest {
  font-size: 11px;
  color: var(--ink-muted);
  line-height: 1.35;
}
.signs-side .sd-reason {
  color: var(--warn);
}
.signs-fee {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 11.5px;
  color: var(--ink);
}
.signs-fee .icon-tile {
  width: 18px;
  height: 18px;
}
.signs-seal-lbl {
  margin-bottom: 6px;
}
.signs-seal-pick {
  margin-bottom: 10px;
}
.signs-notice.ok {
  border-color: rgba(147, 213, 149, 0.45);
}
.signs-notice.ok b {
  color: var(--ok);
}
@media (max-width: 360px) {
  .signs-sides {
    grid-template-columns: 1fr;
  }
}

/* ==== «Почта» (#6873 / #6874) and «Склад» (#6858) ==== */
.head.head--action {
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}
.head.head--action > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.mail-btn {
  position: relative;
}
.mail-btn.active {
  color: var(--accent-strong);
  border-color: var(--accent-glow);
}
.mail-btn .mail-badge {
  top: -5px;
  right: -6px;
}
.mail-screen,
.wh-screen {
  gap: 10px;
}
.mail-busy,
.wh-block {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(201, 162, 75, 0.35);
  background: rgba(201, 162, 75, 0.08);
  color: var(--ink);
}
.mail-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mail-row {
  align-items: flex-start;
}
.mail-row .mail-dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: transparent;
}
.mail-row.unread .mail-dot {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}
.mail-row.unread .pinfo b {
  color: var(--accent-strong);
}
.mail-row .mail-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-chips {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: none;
}
.mail-chips .pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.mail-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mail-view-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.mail-view-head .psub {
  font-size: 11px;
  color: var(--ink-muted);
}
.mail-topic {
  font-size: 15px;
  overflow-wrap: anywhere;
}
.mail-body {
  white-space: pre-line;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.45;
  max-height: 40vh;
  overflow-y: auto;
}
.mail-att-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.mail-att-head .pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.mail-att-grid {
  justify-content: flex-start;
}
.mail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mail-actions .btn {
  flex: 1 1 auto;
}
.mail-compose {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.mail-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mail-field .lbl {
  display: flex;
  justify-content: space-between;
}
.mail-textarea {
  resize: vertical;
  min-height: 90px;
  font-family: var(--font-body);
}
.mail-friends {
  margin-top: 0;
}
.mail-att-line .qty-input {
  width: 58px;
}
.mail-cod {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.mail-cod-toggle.active {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: rgba(201, 162, 75, 0.14);
}
.mail-cod-price {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-muted);
}
.mail-cod-price .qty-input {
  width: 96px;
}
.mail-postage b,
.wh-fee b {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.note.crit {
  color: var(--crit);
}
.wh-meta {
  flex-wrap: wrap;
  gap: 6px;
}
.wh-side {
  margin-top: 2px;
}
.cell.sel {
  border-color: var(--accent);
  background: rgba(201, 162, 75, 0.16);
}
.cell .wh-check {
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: 10px;
  font-weight: 800;
  color: #1a1408;
  background: var(--accent);
  border-radius: 50%;
  width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
}
.wh-sel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wh-sel-line .qty-input {
  width: 58px;
}
.wh-skipped {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--ink-muted);
}

/* «Нужно для этапа» (#7006): the items a quest step brings / crafts — icon,
   RU name, have/need; a shortfall in --crit, an optional item muted. */
.quest-needs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.qneed-reason {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12.5px;
  color: var(--warn);
}
.qneed-reason span {
  font-size: 11.5px;
  color: var(--ink-muted);
}
/* #7220: a step blocked only by items — «Нужно добыть: …» heads «Сейчас»,
   the action of the step, not background. */
.qneed-lead {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 2px 0 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(201, 162, 75, 0.4);
  background: rgba(201, 162, 75, 0.08);
}
.qnl-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.qnl-item .icon-tile {
  width: 32px;
  height: 32px;
  flex: none;
}
.qnl-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.qnl-line {
  font-size: 14px;
  color: var(--ink);
}
.qnl-lbl {
  color: var(--accent-strong);
  font-weight: 600;
}
.qnl-line .num {
  white-space: nowrap;
}
.qnl-line .qneed-miss {
  font-size: 12.5px;
}
.qnl-src {
  font-size: 12px;
  color: var(--ink-muted);
}
.qneed-sec {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.qneed-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12.5px;
}
.qneed-sec > .lbl + .qneed-row,
.qneed-sec > .lbl + .qcraft > .qneed-row:first-child {
  border-top: 0;
}
.qneed-row .icon-tile {
  width: 24px;
  height: 24px;
  flex: none;
}
.qneed-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.qneed-side {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}
.qneed-miss {
  font-size: 11px;
  color: var(--crit);
}
.qneed-row.short .qneed-side .num:first-child {
  color: var(--crit);
}
.qneed-row.met .qneed-side .num {
  color: var(--ok);
}
.qneed-row.opt .qneed-miss {
  color: var(--ink-muted);
}
.qneed-opt {
  color: var(--accent);
}
.qg-row.opt .qg-name,
.qg-row.opt .num {
  color: var(--ink-muted);
}
.qcraft {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 4px;
}
.qcraft + .qcraft {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 4px;
}
.qcraft-recipe {
  display: flex;
  gap: 10px;
  font-size: 12px;
}
.qcraft-recipe .lbl {
  width: 52px;
  flex: none;
  padding-top: 1px;
}
.qcraft-ings {
  padding-left: 12px;
  border-left: 2px solid rgba(201, 162, 75, 0.25);
}
.qcraft-ings .qneed-row .icon-tile {
  width: 20px;
  height: 20px;
}
.qcraft-go {
  margin-top: 2px;
}
.qcraft-note {
  margin-top: -2px;
}
/* The craft under the hunt goal it serves (#7184: 216's Amber Beads). */
.qg-craft {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-left: 27px;
  padding-left: 10px;
  border-left: 2px solid rgba(201, 162, 75, 0.25);
  font-size: 12px;
}
.qgc-line b {
  font-weight: 600;
}
.qgc-hint {
  font-size: 11px;
  color: var(--ink-muted);
}

/* ---- Hunt target: property icons + popover (#6834) -------------------- */
.hunt-target {
  position: relative;
}
.nprops {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  height: 24px;
  overflow: hidden;
}
.nprops--empty {
  height: 24px;
  margin-top: 6px;
}
.nprop {
  flex: none;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.nprop.on {
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.nprop .icon-tile img {
  width: 100%;
  height: 100%;
}
.nprop-pop {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 6;
  padding: 10px 12px;
  border-radius: var(--radius-panel);
  border: 1px solid var(--glass-border);
  background: rgba(14, 15, 21, 0.94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.nprop-pop-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nprop-pop-icon {
  flex: none;
  width: 32px;
  height: 32px;
}
.nprop-pop-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.nprop-pop-desc {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-muted);
  white-space: pre-line;
}

/* ---- Hunt: chips of the other attackers (#6831) ----------------------- */
.hunt-attackers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 5px;
  margin-top: 8px;
  min-height: 38px; /* reserved while hunting: chips come and go without a jump */
}
.hatk {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: 4px 6px 3px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.28);
  font-size: 11px;
  line-height: 1.2;
}
.hatk-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.9);
}
.hatk-lvl {
  font-size: 10px;
  opacity: 0.85;
}
.hatk-hp {
  display: block;
  height: 3px;
  margin-top: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.hatk-hp > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #b5514c, #cf5b54);
}
.hatk-more {
  align-self: center;
  padding: 0 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-muted);
}

/* ---- Item sheet: the client's description (#6971) --------------------- */
.item-desc {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-btn);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--glass-border);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-muted);
  white-space: pre-line;
}

/* ---- Item sheet: one smooth open (#7062) ------------------------------------
   The sheet opens once, at its final height (app.js waits briefly for the
   cached/prefetched details). The rise plays when #itemsheet goes from
   [hidden] (display:none) to shown — a morphdom re-render while it is open
   keeps the same nodes and classes, so it never replays. Long content
   scrolls inside the sheet instead of spilling past 78vh. */
#itemsheet:not([hidden]) {
  animation: itemsheet-scrim-in 160ms ease-out;
}
#itemsheet .picker-sheet {
  overflow-y: auto;
  overscroll-behavior: contain;
}
#itemsheet:not([hidden]) .picker-sheet {
  animation: itemsheet-rise 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes itemsheet-scrim-in {
  from { background-color: rgba(6, 7, 10, 0); }
}
@keyframes itemsheet-rise {
  from { transform: translateY(28px); opacity: 0.4; }
}
@media (prefers-reduced-motion: reduce) {
  #itemsheet:not([hidden]),
  #itemsheet:not([hidden]) .picker-sheet {
    animation: none;
  }
}
/* A slow details answer: rows + a description box, about the size of what
   usually lands, so the sheet barely moves when it does. */
.item-details-skel {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--glass-border);
}
.item-details-skel span,
.item-details-skel i {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  animation: itemsheet-skel-pulse 1.1s ease-in-out infinite alternate;
}
.item-details-skel span:nth-child(2n) {
  width: 82%;
}
.item-details-skel i {
  height: 64px;
  margin-top: 4px;
  border-radius: var(--radius-btn);
}
@keyframes itemsheet-skel-pulse {
  to { background: rgba(255, 255, 255, 0.1); }
}

/* ---- App bar: the account login stays visible at 360 px (#7033; the
   pill names the account since #7069) ------------------------------------ */
.charsel .cs-srv {
  flex: 0 1000 auto; /* gives its room up long before the name does */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.charsel .cs-name {
  min-width: 4.5em;
  color: var(--ink);
}
/* #7266: on a narrow phone the brand shrinks instead of vanishing — the
   account pill gives up its room first (its server name ellipsises). */
@media (max-width: 420px) {
  .appbar .brand {
    flex: 0 0 auto;
    gap: 4px;
    font-size: 13px;
    letter-spacing: 0;
  }
  .appbar .brand-word {
    font-size: 12px;
  }
  .charsel {
    min-width: 0;
    max-width: 60%;
  }
}
@media (max-width: 360px) {
  .appbar .brand {
    font-size: 12px;
    gap: 3px;
  }
  .appbar .brand-word {
    font-size: 10.5px;
  }
  .charsel {
    max-width: 56%;
  }
}
@media (max-width: 400px) {
  .topbar .brand {
    font-size: 15px;
    gap: 5px;
  }
}

/* ---- «Бета» quests (#7041) ------------------------------------------- */
.quest-beta {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 6px;
  vertical-align: 2px;
  border-radius: 999px;
  border: 1px solid var(--accent-glow);
  color: var(--accent-strong);
  background: rgba(201, 162, 75, 0.1);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  line-height: 1.5;
}
.h1 .quest-beta {
  vertical-align: 4px;
}
.quest-beta-hint {
  margin: -4px 0 10px;
}

/* ---- Hunt: the ammo the hunt will use (#7042) ------------------------- */
.ammo-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-top: 8px;
  font-size: 12px;
}
.loadout > .ammo-line {
  margin: 8px 0 0;
}
.ammo-line .lbl {
  margin-right: 2px;
}
.ammo-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ammo-chip .ammo-ic {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
}
.ammo-chip .ammo-ic .icon-tile img {
  width: 100%;
  height: 100%;
}
.ammo-chip.empty .ammo-ic {
  opacity: 0.4;
  filter: grayscale(1);
}
.ammo-chip.empty .num,
.ammo-none {
  color: var(--warn);
}
.ammo-sep {
  color: var(--ink-muted);
}
.ammo-line + .btn {
  margin-top: 8px;
}

/* ---- Item sheet: the quantity a sell / destroy takes (#6719) ---------- */
.inv-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.inv-qty > .lbl {
  margin-right: auto;
}
.inv-qty .qty-stepper {
  flex: none;
}
.inv-qty > .btn {
  flex: none;
  white-space: nowrap;
}
.ammo-line.ammo-live {
  justify-content: flex-start; /* left-aligned, like the pre-start line (#7042) */
  margin-top: 12px;
  font-size: 13px;
}
.ammo-line.ammo-live .ammo-chip .ammo-ic {
  width: 26px;
  height: 26px;
}

/* Party-invite popup on any screen (#7193): the .qconfirm glass modal, above
   the sheets (20/25) and below the toast (30), with a gold countdown bar. */
.qconfirm.pinv {
  z-index: 28;
}
.pinv-card {
  border: 1px solid rgba(201, 162, 75, 0.35);
  box-shadow: var(--shadow-soft), 0 0 24px rgba(201, 162, 75, 0.12);
}
.pinv-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pinv-head .icon-tile {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  border: 1px solid rgba(201, 162, 75, 0.3);
  background: rgba(201, 162, 75, 0.08);
}
.pinv-head .qconfirm-title {
  flex: 1 1 auto;
  min-width: 0;
}
.pinv-card .note b {
  color: var(--accent-strong);
  font-weight: 600;
}
.pinv-timer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
.pinv-track {
  flex: 1 1 auto;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}
.pinv-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  box-shadow: 0 0 8px var(--accent-glow);
  transform-origin: left center;
  transition: transform 0.25s linear;
}
.pinv-secs {
  flex: none;
  min-width: 3.2em;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--ink-muted);
}
.pinv-more {
  font-size: 12px;
}

/* Party loot-mode vote (#7122): the voter's modal is the .pinv modal above;
   the requester's line is a thin glass strip between the viewport and the
   tab bar, on any screen, with the same countdown bar. */
.plv-status {
  flex: 0 0 auto;
  z-index: 5;
  margin: 0 var(--space-3, 12px) 6px;
  padding: 8px 12px 6px;
  border-radius: 11px;
  border: 1px solid rgba(201, 162, 75, 0.35);
  font-size: 12.5px;
  color: var(--ink);
}
.plv-status .pinv-timer {
  margin-top: 5px;
}
.plv-status .pinv-track {
  height: 4px;
}
.plv-status .pinv-secs {
  font-size: 12px;
}
