@charset "utf-8";



html, body { max-width: 100%; overflow-x: hidden; }
.main, .page, .card, .card__body { min-width: 0; }


.nav-toggle { display: none; }
.nav-scrim  { display: none; }
.topbar__actions { display: contents; }
.topbar__id { min-width: 0; }
.topbar__title, .topbar__desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


@media (max-width: 900px) {

  
  .shell { grid-template-columns: 1fr; }

  .nav {
    position: fixed; top: 0; left: 0; z-index: 120;
    width: 264px; max-width: 84vw; height: 100dvh;
    transform: translateX(-100%);
    transition: transform .24s var(--ease);
    box-shadow: 0 0 40px rgba(0,0,0,.28);
    padding-bottom: env(safe-area-inset-bottom);
  }
  body.nav-open .nav { transform: translateX(0); }

  .nav-scrim {
    display: block; position: fixed; inset: 0; z-index: 110;
    background: rgba(28,26,25,.45);
    opacity: 0; pointer-events: none; transition: opacity .24s var(--ease);
  }
  body.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }

  
  .nav a.nav__item { padding: 11px 12px; font-size: 14px; }
  .nav__group { padding: 12px 10px 4px; }

  
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; flex: none;
    border: 1px solid var(--line); background: var(--surface);
    border-radius: var(--r-s); font-size: 16px; line-height: 1;
  }
  .nav-toggle:active { background: var(--line-soft); }

  .topbar {
    height: auto; min-height: 52px; flex-wrap: wrap;
    padding: 8px 12px; gap: 10px; row-gap: 8px;
  }
  .topbar__id { flex: 1 1 auto; }
  .topbar__title { font-size: 14.5px; }
  .topbar__desc { font-size: 11px; }

  
  .topbar__actions {
    display: flex; align-items: center; gap: 8px;
    flex: 1 1 100%; min-width: 0;
    overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .topbar__actions::-webkit-scrollbar { display: none; }
  .scope {
    margin-left: 0; padding-left: 0; border-left: 0;
    flex: none;
  }
  .topbar__right { margin-left: auto; flex: none; }
  .topbar__actions .btn,
  .topbar__actions .select { white-space: nowrap; flex: none; }

  .page { padding: 14px 12px 56px; }

  
  .grid { gap: 12px; }
  .g-5, .g-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .g-3, .g-2, .g-2-1, .g-1-2 { grid-template-columns: minmax(0,1fr); }

  
  .hbar__row { grid-template-columns: 84px 1fr 74px; gap: 8px; }

  
  .card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl__wrap { max-height: none; overflow: auto; }
  .tbl th { position: static; }   

  
  .filterbar { padding: 10px 12px; gap: 8px; }
  .filterbar .field { flex: 1 1 140px; }
  .filterbar .input,
  .filterbar .select { width: 100%; }
  
  .seg { width: 100%; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
  .seg button { flex: 1 0 auto; padding: 0 10px; }

  
  .cal, .calg { overflow-x: auto; }
  .calg { grid-auto-columns: minmax(88px, 1fr); }
  .cal__head, .cal__body { min-width: 620px; }
  .mcell { min-height: 62px; padding: 4px 5px; }
  .mcell__d { font-size: 11.5px; }
  .mcell__c { font-size: 10px; margin-top: 3px; }

  
  .tl { padding-left: 0; }
  .tl__row { flex-direction: column; gap: 4px; padding: 9px 0; }
  .tl__time {
    position: static; width: auto; text-align: left;
    padding-top: 0; font-weight: 700; color: var(--ink-70);
  }

  
  .chat { grid-template-columns: minmax(0,1fr); height: auto; }
  .chat__list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 260px; }
  .chat__pane { min-height: 60vh; }
  .chat__side { display: none; }   
  .msg { max-width: 88%; }

  
  .profile { grid-template-columns: minmax(0,1fr); }
  .wallet { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .dl { grid-template-columns: minmax(88px, auto) 1fr; }

  
  .funnel__row { grid-template-columns: 74px 1fr 68px; gap: 8px; }
  .funnel__label { font-size: 11.5px; }
  .funnel__rate { font-size: 10.5px; }

  
  .modal-bg { padding: 12px; align-items: flex-end; }
  .modal, .modal--wide { width: 100%; max-height: 92dvh; border-radius: 14px; }
  .modal__foot { position: sticky; bottom: 0; background: var(--surface); }
  .slotgrid { grid-template-columns: repeat(4, minmax(0,1fr)); }

  
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { white-space: nowrap; }

  
  .tbl--cards { min-width: 0; }
  .tbl--cards thead { display: none; }
  .tbl--cards tbody tr {
    display: block; margin: 0 0 10px; padding: 11px 12px;
    border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
    box-shadow: var(--shadow-s);
  }
  .tbl--cards tbody td {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 3px 0; border: 0;
  }
  .tbl--cards tbody td::before {
    content: attr(data-th); flex: none; width: 68px;
    color: var(--ink-50); font-size: 11.5px; padding-top: 2px;
  }
  
  .tbl--cards tbody td.c-check { display: none; }
  .tbl--cards tbody td.c-name { padding-bottom: 6px; }
  .tbl--cards tbody td.c-name::before { display: none; }
  .tbl--cards tbody td.c-name .who__name { font-size: 15px; font-weight: 700; }
  
  .tbl--cards tbody td.c-act { padding-top: 9px; }
  .tbl--cards tbody td.c-act::before { display: none; }
  .tbl--cards tbody td.c-act .row { width: 100%; gap: 6px; }
  .tbl--cards tbody td.c-act .btn { flex: 1; padding: 0 6px; }
}


@media (max-width: 640px) {

  body { font-size: 13px; }

  .page { padding: 12px 10px 52px; }
  .card__body { padding: 12px; }
  .card__head { padding: 11px 12px; gap: 8px; flex-wrap: wrap; }
  .card__tools { margin-left: auto; }

  
  .g-5, .g-4 { grid-template-columns: minmax(0,1fr); }
  .hbar__row { grid-template-columns: 72px 1fr 66px; }
  .kpi { padding: 12px 13px; }
  .kpi__value { font-size: 23px; }

  
  .btn { height: 36px; padding: 0 12px; font-size: 13px; }
  .btn--sm { height: 30px; padding: 0 10px; font-size: 12px; }
  .btn--icon { width: 36px; }
  .input, .select { height: 38px; font-size: 13.5px; }
  .seg button { height: 36px; }
  .slot { height: 36px; }
  .tabs button { height: 42px; }

  
  input.input, select.select, textarea.input { font-size: 16px; }

  
  .tbl { font-size: 12px; }
  .tbl th, .tbl td { padding: 8px 10px; }

  .wallet { grid-template-columns: minmax(0,1fr); }
  .slotgrid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .funnel__row { grid-template-columns: 66px 1fr 56px; }

  .chat__list { max-height: 200px; }

  
  .page { padding-bottom: calc(52px + env(safe-area-inset-bottom)); }
  .modal__foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}


@media (max-width: 640px) {
  .nx-login { padding: 16px; min-height: 100dvh; }
  .nx-login__box { padding: 28px 22px 22px; border-radius: 14px; }
  .nx-login__brand { font-size: 23px; }
  .nx-login__input { font-size: 16px; }   
}


@media (max-width: 900px) and (max-height: 480px) {
  .nav { overflow-y: auto; }
  .chat__pane { min-height: 70vh; }
}


@media (prefers-reduced-motion: reduce) {
  .nav, .nav-scrim { transition: none; }
}
