/* ============================================================
   mobile.css — МОБИЛЬНЫЙ СЛОЙ Albion Price Analyzer (≤900px)
   ------------------------------------------------------------
   ПОДКЛЮЧАТЬ ПОСЛЕДНИМ в каждом шаблоне, после tokens.css и
   theme-beta.css:
     <link rel="stylesheet" href="/static/css/mobile.css?v={{ sv }}">

   ГАРАНТИЯ ДЕСКТОПА: ВЕСЬ файл обёрнут в @media (max-width:900px).
   На ширине ≥901px ни одно правило не применяется → десктоп
   визуально идентичен (скрин-диф = 0). Брейкпоинт = 900px (как
   в навбаре), чтобы не было мёртвой зоны 768–900px.

   Все цвета — только через токены из tokens.css (обе темы).
   Хардкод hex запрещён.
   ============================================================ */

/* ── Инфраструктура show/hide (как .nav2-mobile-menu в навбаре) ──
   Единственное немедийное правило в файле: мобильные блоки .m-only скрыты
   на десктопе. Внутри @media(max-width:900px) они показываются. Десктоп не
   затрагивается — на ≥901px эти блоки просто display:none (их там и не должно
   быть), существующая разметка страниц не меняется. */
.m-only { display: none; }
/* Bottom-sheet скрыт на десктопе по умолчанию (его триггеры .m-only тоже скрыты).
   Показ — только внутри медиа-запроса по классу .open. Без этого базового правила
   div.sheet протекал бы на десктоп как обычный блок. */
.sheet { display: none; }

@media (max-width: 900px) {

  .m-only { display: block; }

  /* ── КРИТИЧНЫЙ ФИКС #1: базовый кегль + анти-зум iOS ──
     tokens.css задаёт --font-size-md:14px и input{font-size:13px}.
     iOS зумит поле при фокусе, если font-size < 16px. Поднимаем
     базовый текст и ВСЕ поля до 16px ТОЛЬКО на мобайле. */
  body { font-size: 16px; }
  input, select, textarea,
  .form-control, .amount-input, .home-search-input input {
    font-size: 16px !important;
  }

  /* Тап-таргеты по умолчанию для интерактивов проекта */
  .home-route, .home-chip, .quick-btn { min-height: 44px; }

  .scr { padding: 16px 16px 40px; font-size: 16px; line-height: 1.5; }
  .scr * { box-sizing: border-box; }

  /* ── Section rhythm ── */
  .m-section { margin-top: 28px; }
  .m-section:first-child { margin-top: 4px; }
  .m-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
  .m-sec-head h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); margin: 0; }
  .m-sec-head .more { font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; }
  .m-sub { font-size: 13.5px; color: var(--text-muted); margin: 4px 0 0; line-height: 1.5; }

  /* ── Card shell ── */
  .m-card {
    background: var(--bg-2); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 16px;
  }
  .m-card + .m-card { margin-top: 12px; }

  /* ── Buttons / CTA ── */
  .m-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; min-height: 48px; padding: 0 18px;
    border-radius: var(--radius-lg); border: 1px solid transparent;
    font-family: var(--font-sans); font-size: 16px; font-weight: 600; cursor: pointer;
    text-decoration: none; transition: background 140ms cubic-bezier(0.2,0,0,1), transform 120ms, opacity 140ms;
  }
  .m-btn:active { transform: translateY(1px); }
  .m-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .m-btn-primary { background: var(--accent); color: var(--text-on-dark); }
  .m-btn-primary:hover { background: var(--accent-hover); }
  .m-btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
  .m-btn-secondary:hover { background: var(--bg-3); }
  .m-btn-ghost { background: var(--bg-3); color: var(--text-muted); border-color: var(--border); }
  .m-btn[disabled] { opacity: 0.5; pointer-events: none; }
  .m-btn .spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: m-spin .7s linear infinite; }
  @keyframes m-spin { to { transform: rotate(360deg); } }
  .m-link { color: var(--accent); font-weight: 600; font-size: 15px; text-decoration: none; }

  /* ── Eyebrow / hero ── */
  .m-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--radius-pill);
    background: rgba(227,163,65,.12); color: #e3a341; border: 1px solid rgba(227,163,65,.3);
    font-size: 12.5px; font-weight: 600; }
  .m-eyebrow .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--success);
    box-shadow: 0 0 0 0 rgba(63,185,80,.6); animation: m-pulse 2s infinite; }
  @keyframes m-pulse { 0%{box-shadow:0 0 0 0 rgba(63,185,80,.5)} 70%{box-shadow:0 0 0 8px rgba(63,185,80,0)} 100%{box-shadow:0 0 0 0 rgba(63,185,80,0)} }
  .m-h1 { font-size: 30px; line-height: 1.08; letter-spacing: -0.025em; font-weight: 800; color: var(--text); margin: 14px 0 10px; text-wrap: balance; }
  .m-h1 em { font-style: normal; background: linear-gradient(180deg,#ffd9a8,#f59e3c); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .m-lead { font-size: 15px; color: var(--text-muted); margin: 0 0 16px; line-height: 1.55; }
  .m-lead b { color: var(--text); font-weight: 600; }
  .m-hero-cta { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
  .m-freshness { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 12.5px; color: var(--text-muted); }
  .m-freshness .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); }
  .m-freshness b { color: var(--text); }

  /* ── Chips-scroll (фильтры, вариант A) ── */
  .m-chips-rail { position: relative; margin: 0 -16px; }
  .m-chips-rail::after { content: ""; position: absolute; top: 0; right: 0; bottom: 8px; width: 36px; pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--bg)); }
  .m-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 10px; scroll-snap-type: x proximity; scrollbar-width: none; }
  .m-chips::-webkit-scrollbar { height: 0; }
  .m-chip {
    flex: 0 0 auto; scroll-snap-align: start;
    display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 16px;
    border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--bg-2);
    color: var(--text-muted); font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer;
    transition: 120ms cubic-bezier(0.2,0,0,1);
  }
  .m-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .m-chip.active { background: var(--accent-bg); border-color: rgba(88,166,255,.45); color: var(--accent); }
  .m-chip .ct { font-family: var(--font-mono); font-size: 12px; opacity: .7; }

  /* ── Filter bar (открывает bottom-sheet, вариант B) ── */
  .m-filterbar { display: flex; gap: 10px; }
  .m-filterbar .m-btn { width: auto; flex: 1; min-height: 46px; font-size: 15px; }
  .m-filter-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px;
    padding: 0 6px; border-radius: var(--radius-pill); background: var(--accent); color: var(--text-on-dark);
    font-size: 11px; font-weight: 700; }

  /* ── Item carousel (Топ-5) ── */
  .m-carousel { display: flex; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 14px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .m-carousel::-webkit-scrollbar { height: 0; }
  .m-itemcard { flex: 0 0 82%; scroll-snap-align: start; background: linear-gradient(180deg,var(--bg-2),var(--bg-3));
    border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 16px; display: flex; flex-direction: column; gap: 12px;
    text-decoration: none; color: inherit; position: relative; }
  .m-itemcard .rank { position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; border-radius: 8px; background: var(--bg-3);
    border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-family: var(--font-mono);
    font-size: 11px; font-weight: 700; color: var(--text-subtle); }
  .m-itemcard.rank-1 .rank { color: #e3a341; border-color: rgba(245,158,60,.4); }
  .m-item-head { display: flex; gap: 12px; align-items: center; }
  .m-item-icon { width: 56px; height: 56px; border-radius: 12px; background: radial-gradient(circle at 30% 25%,var(--bg-3),var(--bg));
    border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--text-subtle); }
  .m-badges { display: flex; gap: 5px; margin-bottom: 5px; }
  .m-tier, .m-ench { padding: 2px 7px; border-radius: 4px; font-family: var(--font-mono); font-size: 11px; font-weight: 700; }
  .m-item-name { font-size: 15px; font-weight: 600; color: var(--text); margin: 0; line-height: 1.2; }
  .m-profit { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; position: relative; overflow: hidden; }
  .m-profit::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--success); }
  .m-profit-row { display: flex; justify-content: space-between; align-items: baseline; }
  .m-profit-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-subtle); font-weight: 600; }
  .m-margin-pill { display: inline-flex; padding: 3px 8px; background: rgba(63,185,80,.12); color: var(--success); border-radius: 6px;
    font-family: var(--font-mono); font-size: 12px; font-weight: 700; }
  .m-profit-amount { font-family: var(--font-mono); font-size: 22px; font-weight: 700; color: var(--success); margin-top: 4px; }
  .m-profit-amount .unit { font-size: 12px; color: var(--text-muted); margin-left: 3px; }

  /* ── Route chips (компактный блок ниже fold) ── */
  .m-routes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .m-route { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; border-radius: var(--radius-lg);
    border: 1px solid var(--border); background: var(--bg-2); color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; }
  .m-route svg { width: 17px; height: 17px; color: var(--accent); flex-shrink: 0; }

  /* ── Tool / community rows ── */
  .m-rows { display: flex; flex-direction: column; gap: 10px; }
  .m-row { display: flex; align-items: center; gap: 13px; padding: 14px; background: var(--bg-2); border: 1px solid var(--border);
    border-radius: var(--radius-lg); text-decoration: none; color: inherit; min-height: 64px; }
  .m-row .ic { width: 44px; height: 44px; border-radius: 11px; background: var(--bg-3); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--text-muted); }
  .m-row .ic.accent { background: rgba(245,158,60,.14); color: #e3a341; border-color: rgba(245,158,60,.3); }
  .m-row .ic.discord { background: rgba(88,101,242,.16); color: #8a9bff; border-color: rgba(88,101,242,.3); }
  .m-row .ic.success { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
  .m-row .tx { min-width: 0; flex: 1; }
  .m-row .tt { font-size: 14.5px; font-weight: 600; color: var(--text); }
  .m-row .ds { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
  .m-row .chev { color: var(--text-subtle); flex-shrink: 0; }

  /* ── Search field ── */
  .m-field { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 0 14px; min-height: 50px; }
  .m-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
  .m-field svg { width: 18px; height: 18px; color: var(--text-subtle); flex-shrink: 0; }
  .m-field input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--text); font-size: 16px; font-family: inherit; }
  .m-field input::placeholder { color: var(--text-subtle); }

  /* ============================================================
     DATA — card/list view (вариант A)
     ============================================================ */
  .m-dcard { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
  .m-dcard + .m-dcard { margin-top: 10px; }
  .m-dcard-head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px; background: transparent; border: 0; cursor: pointer; text-align: left; }
  .m-dcard-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  .m-dcard-icon { width: 42px; height: 42px; border-radius: 10px; background: radial-gradient(circle at 30% 25%,var(--bg-3),var(--bg));
    border: 1px solid var(--border); flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--text-subtle); font-family: var(--font-mono); font-size: 11px; }
  .m-dcard-main { min-width: 0; flex: 1; }
  .m-dcard-name { font-size: 14.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-dcard-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; display: flex; gap: 8px; align-items: center; }
  .m-dcard-kpi { text-align: right; flex-shrink: 0; }
  .m-dcard-kpi .v { font-family: var(--font-mono); font-size: 15px; font-weight: 700; color: var(--success); }
  .m-dcard-kpi .v.neg { color: var(--danger); }
  .m-dcard-kpi .l { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-subtle); margin-top: 2px; }
  .m-dcard-chev { color: var(--text-subtle); transition: transform 200ms cubic-bezier(0.2,0,0,1); flex-shrink: 0; }
  .m-dcard.open .m-dcard-chev { transform: rotate(180deg); }
  .m-dcard-detail { display: none; padding: 0 14px 14px; }
  .m-dcard.open .m-dcard-detail { display: block; animation: m-reveal 200ms cubic-bezier(0.2,0,0,1); }
  @keyframes m-reveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
  .m-kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border-muted); font-size: 13.5px; }
  .m-kv .k { color: var(--text-muted); }
  .m-kv .val { color: var(--text); font-weight: 600; font-family: var(--font-mono); }

  /* ============================================================
     DATA — compact table, horizontal scroll (вариант B)
     ============================================================ */
  .m-tablewrap { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-2); }
  .m-scroll-hint { display: flex; align-items: center; gap: 6px; padding: 8px 12px; font-size: 11.5px; color: var(--text-subtle);
    background: var(--bg-3); border-bottom: 1px solid var(--border); }
  .m-scroll-hint svg { animation: m-swipe 1.8s ease-in-out infinite; }
  @keyframes m-swipe { 0%,100%{transform:translateX(0)} 50%{transform:translateX(5px)} }
  .m-tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .m-tbl { border-collapse: collapse; font-size: 13px; white-space: nowrap; min-width: 580px; }
  .m-tbl th, .m-tbl td { padding: 11px 12px; text-align: right; border-bottom: 1px solid var(--border-muted); }
  .m-tbl th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-subtle); font-weight: 700;
    background: var(--bg-3); position: sticky; top: 0; }
  .m-tbl th.sortable { cursor: pointer; }
  .m-tbl th.sort-desc::after { content: " ↓"; color: var(--accent); }
  .m-tbl th:first-child, .m-tbl td:first-child { text-align: left; position: sticky; left: 0; background: var(--bg-2);
    box-shadow: 1px 0 0 var(--border); }
  .m-tbl th:first-child { background: var(--bg-3); z-index: 1; }
  .m-tbl td.num { font-family: var(--font-mono); color: var(--text); }
  .m-tbl td .pos { color: var(--success); }
  .m-tbl td .neg { color: var(--danger); }
  .m-tbl tfoot td { position: sticky; bottom: 0; background: var(--bg-3); font-family: var(--font-mono); font-weight: 700;
    color: var(--text); border-top: 1px solid var(--border); }
  .m-tname { display: inline-flex; align-items: center; gap: 8px; }
  .m-tname .ic { width: 26px; height: 26px; border-radius: 6px; background: var(--bg-3); border: 1px solid var(--border); flex-shrink: 0; }

  /* ============================================================
     BOTTOM SHEET
     ============================================================ */
  /* fixed (не absolute): в реальном проекте шторка крепится к вьюпорту,
     а не к ближайшему позиционированному предку; z-index выше навбара (100). */
  .sheet { position: fixed; inset: 0; z-index: 1000; display: none; }
  .sheet.open { display: block; }
  .sheet-scrim { position: absolute; inset: 0; background: rgba(1,4,9,.6); animation: m-fade 200ms ease; }
  @keyframes m-fade { from { opacity: 0; } to { opacity: 1; } }
  .sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88%; display: flex; flex-direction: column;
    background: var(--bg-overlay); border-top: 1px solid var(--border); border-radius: 18px 18px 0 0;
    animation: m-slideup 240ms cubic-bezier(0.2,0,0,1); }
  @keyframes m-slideup { from { transform: translateY(100%); } to { transform: none; } }
  .sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 10px auto 4px; flex-shrink: 0; }
  .sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 18px 12px; border-bottom: 1px solid var(--border); }
  .sheet-head h3 { font-size: 16px; font-weight: 700; margin: 0; color: var(--text); }
  .sheet-close { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-md);
    background: transparent; border: 0; color: var(--text-muted); cursor: pointer; }
  .sheet-body { padding: 16px 18px; overflow-y: auto; }
  .sheet-foot { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); display: flex; gap: 10px; }
  .sheet-foot .m-btn { flex: 1; }
  .sheet-group { margin-bottom: 18px; }
  .sheet-group h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-subtle); margin: 0 0 10px; }
  .sheet-opts { display: flex; flex-wrap: wrap; gap: 8px; }

  /* ============================================================
     FORMS
     ============================================================ */
  .m-form { display: flex; flex-direction: column; gap: 16px; }
  .m-formrow { display: flex; flex-direction: column; gap: 7px; }
  .m-formrow > label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
  .m-input, .m-textarea {
    width: 100%; background: var(--bg); border: 1px solid var(--input-border); border-radius: var(--radius-md);
    color: var(--text); font-family: inherit; font-size: 16px; padding: 13px 14px; min-height: 48px;
    transition: border-color 140ms, box-shadow 140ms;
  }
  .m-textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
  .m-input:focus, .m-textarea:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-bg); }
  .m-input.invalid, .m-textarea.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }
  .m-err { font-size: 12.5px; color: var(--danger); display: flex; gap: 6px; align-items: center; }
  .m-help { font-size: 12px; color: var(--text-subtle); }
  .m-counter { text-align: right; font-size: 12px; color: var(--text-subtle); }
  .m-alert { border-radius: var(--radius-md); padding: 12px 14px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
  .m-alert.ok { background: var(--success-bg); border: 1px solid var(--success-border); color: var(--success); }
  .m-alert.bad { background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger); }
  .m-sticky-submit { position: sticky; bottom: 0; margin: 8px -16px -40px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, transparent, var(--bg) 28%); }

  /* quick-amount grid (payment) */
  .m-amounts { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
  .m-amount { min-height: 48px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--bg-3);
    color: var(--text-muted); font-size: 16px; font-weight: 700; cursor: pointer; }
  .m-amount.selected { border-color: #e3a341; color: #e3a341; background: rgba(227,163,65,.08); }
  .m-amount-big { position: relative; }
  .m-amount-big input { width: 100%; background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--radius-lg);
    color: var(--text); font-size: 26px; font-weight: 700; padding: 14px 48px 14px 16px; outline: none; }
  .m-amount-big input:focus { border-color: #e3a341; box-shadow: 0 0 0 3px rgba(227,163,65,.15); }
  .m-amount-big .cur { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 20px; font-weight: 700; color: var(--text-subtle); }

  /* segmented tabs (auth) */
  .m-tabs { display: flex; gap: 4px; background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 4px; }
  .m-tabs button { flex: 1; min-height: 40px; border: 0; background: transparent; color: var(--text-muted); font-size: 14px; font-weight: 600; border-radius: 6px; cursor: pointer; }
  .m-tabs button.on { background: var(--bg-overlay); color: var(--text); box-shadow: var(--shadow-sm); }
  .m-social { display: flex; flex-direction: column; gap: 8px; }
  .m-social .m-btn { background: var(--bg); border-color: var(--border); color: var(--text); }
  .m-divider { display: flex; align-items: center; gap: 12px; color: var(--text-subtle); font-size: 12px; margin: 4px 0; }
  .m-divider::before, .m-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

  /* ============================================================
     FAQ accordion (APG)
     ============================================================ */
  .m-faq { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-2); }
  .acc-item { border-bottom: 1px solid var(--border-muted); }
  .acc-item:last-child { border-bottom: 0; }
  .acc-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px;
    background: transparent; border: 0; cursor: pointer; text-align: left; font-family: inherit; font-size: 15px; font-weight: 600; color: var(--text); min-height: 56px; }
  .acc-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  .acc-ico { flex-shrink: 0; color: var(--text-subtle); transition: transform 200ms cubic-bezier(0.2,0,0,1); }
  .acc-item.open .acc-ico { transform: rotate(180deg); color: var(--accent); }
  .acc-item.open .acc-btn { color: var(--accent); }
  .acc-panel { display: none; padding: 0 16px 16px; font-size: 14px; line-height: 1.65; color: var(--text-muted); }
  .acc-item.open .acc-panel { display: block; animation: m-reveal 200ms cubic-bezier(0.2,0,0,1); }

  /* ============================================================
     STATES — empty / loading / error
     ============================================================ */
  .m-state { text-align: center; padding: 40px 20px; }
  .m-state .ico { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
    background: var(--bg-3); border: 1px solid var(--border); color: var(--text-subtle); }
  .m-state .ico.bad { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
  .m-state h3 { font-size: 16px; font-weight: 700; color: var(--text); margin: 0 0 6px; }
  .m-state p { font-size: 13.5px; color: var(--text-muted); margin: 0 auto 18px; max-width: 30ch; line-height: 1.5; }
  .m-skel { background: linear-gradient(90deg,var(--bg-3) 0%,var(--bg-2) 50%,var(--bg-3) 100%); background-size: 200% 100%;
    animation: m-shim 1.4s infinite; border-radius: 6px; }
  @keyframes m-shim { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
  .m-skel-card { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-2); }

  /* ============================================================
     MOBILE NAV (улучшенный визуал меню-оверлея)
     ============================================================ */
  .mn { display: flex; flex-direction: column; height: 100%; background: var(--bg-overlay); }
  .mn-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
  .mn-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; color: var(--text); }
  .mn-brand svg { color: var(--accent); }
  .mn-x { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-md);
    background: transparent; border: 0; color: var(--text-muted); cursor: pointer; }
  .mn-body { flex: 1; overflow-y: auto; padding: 12px; }
  .mn-plus { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; border-radius: var(--radius-md);
    background: linear-gradient(180deg,#f0b429,#e09b00); color: #1a1205; font-size: 15px; font-weight: 700; text-decoration: none; margin-bottom: 14px; }
  .mn-feedback { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; border-radius: var(--radius-md);
    background: var(--bg-2); border: 1px solid var(--border); color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; margin-bottom: 14px; }
  .mn-sec { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-subtle); padding: 14px 10px 6px; }
  .mn-item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 10px; border-radius: var(--radius-md);
    color: var(--text); font-size: 15px; font-weight: 500; text-decoration: none; }
  .mn-item:active { background: var(--nav-hover-bg); }
  .mn-item .mi { width: 30px; height: 30px; border-radius: 8px; background: var(--bg-3); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center; color: var(--text-muted); flex-shrink: 0; }
  .mn-item .chev { margin-left: auto; color: var(--text-subtle); }
  .mn-foot { display: flex; align-items: center; gap: 10px; padding: 14px 12px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); flex-shrink: 0; flex-wrap: wrap; }
  .mn-ctl { min-height: 44px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; border-radius: var(--radius-md);
    border: 1px solid var(--border); background: var(--bg-2); color: var(--text-muted); font-size: 13px; font-weight: 600; cursor: pointer; }
  .mn-lang { display: flex; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
  .mn-lang button { min-width: 46px; min-height: 44px; border: 0; background: transparent; color: var(--text-subtle); font-size: 13px; font-weight: 700; cursor: pointer; }
  .mn-lang button.on { background: var(--accent-bg); color: var(--accent); }

  /* ── Привязка card-view к конкретным data-страницам ──
     Десктоп-таблицы рендерятся JS и получают inline display:'' — поэтому
     перебиваем !important. Мобильные карточки (.m-only) показаны автоматически. */
  #resultsTable { display: none !important; }          /* Чёрный рынок */
  .bm-mobile { margin-top: 4px; }
  .bmc-city { padding: 10px 0; border-top: 1px solid var(--border-muted); }
  .bmc-city:first-child { border-top: 0; }
  .bmc-city-head { display: flex; justify-content: space-between; align-items: baseline;
    font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 6px; }

  /* small helpers */
  .muted { color: var(--text-muted); }
  .tier-t4 { background: var(--tier-t4); color: #fff; }
  .tier-t5 { background: var(--tier-t5); color: #fff; }
  .tier-t6 { background: var(--tier-t6); color: #000; }
  .tier-t7 { background: var(--tier-t7); color: #000; }
  .tier-t8 { background: var(--tier-t8); color: #000; }
  .enchant-1 { background: var(--enchant-1); color: #000; }
  .enchant-2 { background: var(--enchant-2); color: #000; }
  .enchant-3 { background: var(--enchant-3); color: #fff; }
  .enchant-4 { background: var(--enchant-4); color: #000; }

}
