/* Быстрый режим и уведомления: прежние жесты и обработчики. */
  .stage { min-height:100vh; display:flex; align-items:center; justify-content:center; background:var(--bg); padding:20px; gap:20px; flex-direction:column; }
  .phone { width:390px; height:780px; max-height:calc(100vh - 96px); background:var(--panel); border:1px solid var(--line); border-radius:32px; box-shadow:var(--lift); overflow:hidden; display:flex; flex-direction:column; }
  .mtop { flex:0 0 auto; padding:14px 16px; border-bottom:1px solid var(--line); display:flex; align-items:center; gap:10px; }
  .mbody { flex:1 1 auto; overflow-y:auto; padding:14px 16px 20px; display:flex; flex-direction:column; gap:12px; }
  .mbody > *, .mbody .mrow, .mbody .msec { flex-shrink:0; }
  .mnav { flex:0 0 auto; border-top:1px solid var(--line); display:flex; }
  .mnav button { flex:1 1 0; min-height:56px; border:none; background:none; color:var(--muted); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; font-size:11px; cursor:pointer; }
  .mnav button.on { color:var(--accent); }
  .mrow { display:flex; flex-direction:column; gap:4px; padding:12px 13px; min-height:44px; border:1px solid var(--line); border-radius:12px; background:var(--panel); text-align:left; color:inherit; cursor:pointer; width:100%; font-size:14px; }
  .mrow:active { background:var(--hover); }

  /* Смахивание строки: вправо — снять действие, влево — закрыть работу.
     Подложки лежат под строкой и проступают по мере сдвига, поэтому по цвету
     сразу видно, что случится. Строка едет через transform, чтобы жест шёл
     на видеокарте и не дёргался на слабых телефонах. */
  .swipe { position:relative; border-radius:12px; overflow:hidden; flex-shrink:0; }
  .swipe-back { position:absolute; inset:0; display:flex; align-items:center; gap:8px;
    font-size:13px; font-weight:600; border-radius:12px; opacity:0; }
  .swipe-back.right { justify-content:flex-start; padding-left:18px; background:var(--ok-soft); color:var(--ok); }
  .swipe-back.left  { justify-content:flex-end;   padding-right:18px; background:var(--bad-soft); color:var(--bad); }
  .swipe.pull-right .swipe-back.right, .swipe.pull-left .swipe-back.left { opacity:1; }
  .swipe .mrow { position:relative; transition:transform .18s ease; will-change:transform; touch-action:pan-y; }
  .swipe.dragging .mrow { transition:none; }
  .swipe.gone { transition:height .2s ease, opacity .2s ease, margin .2s ease; height:0; opacity:0; margin:0; }
  .mcall { display:flex; align-items:center; justify-content:center; gap:9px; min-height:52px; width:100%; border:none; border-radius:14px; background:var(--accent); color:var(--on-accent); font-size:16px; font-weight:600; cursor:pointer; }
  .msec { display:flex; flex-direction:column; gap:9px; border:1px solid var(--line); border-radius:14px; padding:13px; }
  .mfld { width:100%; background:var(--field); border:1px solid var(--line); border-radius:10px; padding:11px 12px; color:var(--text); font-size:14px; outline:none; min-height:44px; }
  .mfld:focus { border-color:var(--accent); }
  textarea.mfld { resize:none; height:82px; }
  .mchip { border:1px solid var(--line); border-radius:9px; padding:9px 12px; min-height:40px; color:var(--text2); background:var(--panel); cursor:pointer; font-size:13px; }
  .mchip.on { background:var(--accent); border-color:var(--accent); color:var(--on-accent); font-weight:600; }
  @media (max-width:760px) {
    .stage { padding:0; align-items:stretch; }
    /*
      Телефон занимает экран целиком и масштабируется под его ширину.
      Раньше все размеры были жёстко в пикселях от макета 390px: на узком
      аппарате строки не помещались, на широком половина экрана пустовала,
      и каждый телефон выглядел по-своему.

      --mscale ставит скрипт (ширина экрана / 390) — при zoom вся вёрстка,
      включая шрифты и отступы, растягивается пропорционально, поэтому
      картинка на любом аппарате одна и та же, просто крупнее или мельче.
      Собственные размеры делим на масштаб, иначе экран вылезет за края.

      dvh, а не vh: на телефоне адресная строка прячется и появляется,
      и при vh нижняя панель уезжает под неё.
    */
    .phone {
      zoom: var(--mscale, 1);
      width: calc(100vw / var(--mscale, 1));
      height: calc(100vh / var(--mscale, 1));
      height: calc(100dvh / var(--mscale, 1));
      max-height:none; border:none; border-radius:0; box-shadow:none;
    }
  }
  .tag { font-size:11px; line-height:1.5; padding:1px 7px; border-radius:20px; white-space:nowrap; }
  .tag.company { background:var(--soft); color:var(--text2); }
  .tag.solo { background:transparent; color:var(--muted); border:1px dashed var(--line); }
  .tag.other { background:var(--warn-soft); color:var(--warn); font-weight:500; }
  .iconbtn.ringing { border-color:var(--bad); }
  .bell-dot { position:absolute; top:-4px; right:-4px; min-width:16px; height:16px; padding:0 4px;
    border-radius:9px; background:var(--bad); color:#FFF; font-size:10px; font-weight:700;
    display:flex; align-items:center; justify-content:center; line-height:1; }
  /* Панель лежит поверх страницы, поэтому ей нужна собственная граница и тень:
     на белом фоне без них текст под ней читался как продолжение списка. */
  .bell-panel { position:absolute; right:0; top:40px; z-index:60; width:min(340px, calc(100vw - 24px)); max-height:60vh; overflow:auto;
    background:var(--panel); border:1px solid var(--muted); border-radius:12px;
    box-shadow:0 18px 48px -12px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.04); }
  .bell-head { display:flex; align-items:center; gap:8px; padding:10px 12px; border-bottom:1px solid var(--line); }
  .bell-row { display:flex; width:100%; padding:9px 12px; gap:10px; background:none; border:0;
    border-bottom:1px solid var(--line); cursor:pointer; text-align:left; color:inherit; }
  .bell-row:hover { background:var(--soft); }
  .bell-row:last-child { border-bottom:0; }
  .bell-row.fresh { background:var(--accent-soft, var(--soft)); }


/* Дашборд на телефоне: направления → одно направление (mobile.js → mobileDash). */
.md-tot { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
.md-tot span { display:flex; flex-direction:column; gap:2px; padding:10px; border-radius:12px; background:var(--rail); font-size:11px; color:var(--muted); }
.md-tot b { font-size:20px; color:var(--text); }
.md-tot b.bad { color:var(--bad); } .md-tot b.ok { color:var(--ok); }
.md-dir { display:flex; align-items:center; gap:12px; width:100%; min-height:72px; padding:12px; border:1px solid var(--line); border-left:4px solid var(--dir); border-radius:14px; background:var(--panel); color:var(--text); text-align:left; cursor:pointer; }
.md-dir:active { background:var(--hover); }
.md-dir-text { flex:1; min-width:0; display:flex; flex-direction:column; gap:3px; font-size:12px; color:var(--muted); }
.md-dir-text strong { font-size:15px; color:var(--text); line-height:1.25; }
.md-dir-text b.bad { color:var(--bad); }
.md-note { font-size:12px; line-height:1.4; color:var(--bad); }
.md-note.wait { color:var(--warn); }
.md-ro { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--muted); }
.md-strip { display:flex; gap:6px; overflow-x:auto; padding-bottom:2px; scrollbar-width:none; }
.md-strip span { flex:0 0 auto; display:flex; align-items:baseline; gap:5px; padding:8px 11px; border-radius:10px; background:var(--rail); font-size:12px; color:var(--muted); white-space:nowrap; }
.md-strip span.has { color:var(--text2); box-shadow:inset 0 -3px 0 var(--dir); }
.md-strip span.bad { color:var(--bad); box-shadow:inset 0 -3px 0 var(--bad); }
.md-strip b { font-size:16px; color:inherit; }
.md-item { border:1px solid var(--line); border-radius:14px; overflow:hidden; }
.md-item.late { box-shadow:inset 3px 0 0 var(--bad); }
.md-item.open { border-color:var(--muted); }
.md-item-head { display:flex; flex-direction:column; gap:6px; width:100%; min-height:44px; padding:12px 13px; border:0; background:var(--panel); color:var(--text); text-align:left; cursor:pointer; }
.md-item-body { display:flex; flex-direction:column; gap:6px; padding:10px 13px 13px; border-top:1px solid var(--soft); background:var(--rail); }
.md-item-body h3 { font-size:11px; font-weight:600; color:var(--muted); margin-top:4px; }
.md-item-body ul { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:5px; }
.md-item-body li { display:grid; grid-template-columns:52px minmax(0,1fr); gap:6px; font-size:13px; }
.md-item-body time { font-family:'IBM Plex Mono',monospace; font-weight:600; color:var(--text2); font-size:12px; }
.md-item-body time.bad { color:var(--bad); } .md-item-body time.ok { color:var(--ok); }
.md-item-body em { font-style:normal; color:var(--muted); }
.md-item-body p { font-size:13px; color:var(--muted); }
.md-feed { position:static; border:1px solid var(--line); border-radius:14px; }
.mbody b.bad { color:var(--bad); }
.mbody .db-loose { flex:none; }

/* Шторка «Закрыть дело» на телефоне */
.phone { position:relative; }
.msheet-scrim { position:absolute; inset:0; z-index:40; border:0; background:color-mix(in srgb,var(--text) 30%,transparent); animation:msheet-fade 200ms ease; }
.msheet { position:absolute; left:0; right:0; bottom:0; z-index:41; display:flex; flex-direction:column; gap:10px; padding:10px 16px calc(16px + env(safe-area-inset-bottom)); border-radius:20px 20px 0 0; background:var(--panel); box-shadow:0 -10px 30px rgba(22,28,24,.18); animation:msheet-up 280ms cubic-bezier(.22,1,.36,1); }
.msheet-grip { align-self:center; width:40px; height:4px; border-radius:2px; background:var(--line); margin-bottom:4px; }
.msheet-res { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
.msheet-res .mchip { min-height:44px; font-weight:600; }
.msheet textarea.mfld { height:84px; }
@keyframes msheet-up { from { transform:translateY(100%); } to { transform:none; } }
@keyframes msheet-fade { from { opacity:0; } to { opacity:1; } }
@media (prefers-reduced-motion: reduce) { .msheet, .msheet-scrim { animation:none; } }
@media (max-width:760px) { .msheet-scrim, .msheet { position:fixed; } }
