/* Specialist mini-app (/m/) — same visual language as the inbox. Tokens and components: /ui/ds.css. */
html, body { height: 100%; }
body { font-size: 15px; }
.center { text-align: center; }
.login-card { text-align: center; }
.login-card .brand { justify-content: center; }

/* shell: full-height column, content scrolls between the bar and the tabs */
.app { height: 100%; display: flex; flex-direction: column; max-width: 720px; margin: 0 auto; background: var(--canvas); }
.bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top));
  color: var(--navy-ink); min-height: 58px;
  background: radial-gradient(160px 110px at 100% 0%, rgba(219,57,150,.38), transparent 75%),
              linear-gradient(100deg, #035F86 0%, #04709D 55%, #0593C6 100%); }
.bar .icon-btn { background: none; border: 0; color: #EAF6FB; }
.bar .icon-btn:hover { background: var(--glass); color: var(--on-bar); }
.bar .icon-btn .ic { width: 20px; height: 20px; }
.bar-title { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-left: 4px; }
.bar-title b { color: var(--on-bar); font-size: 16px; font-weight: 800; }
.bar-title small { color: var(--navy-muted); font-size: 12px; font-weight: 600; }
.bar-title b, .bar-title small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view { flex: 1; min-height: 0; overflow-y: auto; }
.tabs { display: flex; background: var(--surface); border-top: 1px solid var(--border); border-bottom: 0; padding: 0;
  padding-bottom: env(safe-area-inset-bottom); }
.tabs button { flex: 1; border: 0; border-radius: 0; background: none; padding: 9px 4px 8px; font-size: 11.5px;
  color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; }
.tabs button .ic { width: 22px; height: 22px; }
.tabs button.on { color: var(--accent); }
.tabs button.on .ic { filter: drop-shadow(var(--shadow-icon)); }
.app.in-chat .tabs { display: none; }

/* chat list */
.chats { list-style: none; margin: 0; padding: 8px; display: grid; gap: 6px; background: var(--list-wash); min-height: 100%;
  align-content: start; } /* мало заявок — карточки не растягиваются на весь экран (05.11) */
.chat-item { display: flex; gap: 12px; padding: 13px 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; cursor: pointer; min-width: 0; box-shadow: var(--shadow-xs); }
.chat-item:active { background: var(--accent-soft); }
.chat-item .avatar { position: relative; }
.chat-item .avatar.lead { background: var(--surface); color: var(--accent-ink); box-shadow: inset 0 0 0 1.5px var(--border-2); }
.chat-item .avatar .cd { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px;
  border: 2px solid var(--surface); }
.chat-body { flex: 1; min-width: 0; display: grid; gap: 5px; align-content: start; }
.row { display: flex; gap: 6px; align-items: center; min-width: 0; flex-wrap: wrap; }
.row:first-child { flex-wrap: nowrap; }
.name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.time { margin-left: auto; font-size: 11.5px; color: var(--muted); flex: none; }
.preview { font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* chat */
.chat { display: flex; flex-direction: column; overflow: hidden; }
.req { padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; gap: 6px;
  flex-wrap: wrap; align-items: center; font-size: 13px; }
.req .desc { flex-basis: 100%; color: var(--ink-soft); white-space: pre-wrap; font-size: 13px; margin-top: 4px; }
.req .outcome-note { flex-basis: 100%; display: flex; gap: 6px; margin-top: 6px; opacity: .75; }
.req .outcome-note select, .req .outcome-note input { font-size: 12px; flex: 1 1 0; min-width: 0; width: 0; }
.msgs { list-style: none; margin: 0; padding: 14px 12px; flex: 1; overflow-y: auto; display: flex; flex-direction: column;
  gap: 10px; background: var(--canvas); }
.m { max-width: 84%; padding: 9px 13px 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border);
  align-self: flex-start; border-bottom-left-radius: 6px; font-size: 15px; line-height: 1.45; }
.m.out { align-self: flex-end; background: var(--bubble-out); color: var(--on-bar); border-color: transparent;
  border-bottom-left-radius: 18px; border-bottom-right-radius: 6px; box-shadow: var(--shadow-bubble); }
/* Everyone on "our" side — bot, specialist — sits on the RIGHT; only color/label differ (§
   окончательно определились со стороной, 23.10). */
.m.bot { background: color-mix(in srgb, var(--accent-soft) 80%, var(--surface)); color: var(--ink-soft);
  border-color: color-mix(in srgb, var(--accent) 14%, transparent); font-size: 14px; }
.m .who { font-size: 12px; font-weight: 700; color: var(--accent-ink); margin-bottom: 2px; }
.m.out .who, .m.out .meta { color: #DDF0F8; }
.m.bot .who { color: var(--accent-ink); } .m.bot .meta { color: var(--muted); }
.m .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.m .meta { font-size: 10.5px; color: var(--muted); text-align: right; margin-top: 3px; font-variant-numeric: tabular-nums; }
.m .meta.failed { color: var(--urgent); }
.m.out .meta.failed { color: #ffd2d0; }
.m img { display: block; width: 100%; max-width: 240px; border-radius: 10px; margin-top: 6px; cursor: zoom-in; }
.actions { display: flex; gap: 8px; padding: 8px 12px; overflow-x: auto; background: var(--surface);
  border-top: 1px solid var(--border); }
.actions button { flex: none; border-radius: 999px; padding: 8px 14px; }
.actions button.main { background: var(--ok); border-color: var(--ok); color: var(--on-bar); }
.sheet { background: var(--surface); border-top: 1px solid var(--border); padding: 14px; display: grid; gap: 10px;
  box-shadow: var(--shadow-lg); }
.sheet .row { flex-wrap: wrap; }
.sheet .close { margin-left: auto; }
.sheet select, .sheet input { flex: 1; }
.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slots button { font-variant-numeric: tabular-nums; }
.slots button.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; max-height: 50vh; overflow-y: auto; }
.facts li { padding: 10px 4px; border-top: 1px solid var(--border); cursor: pointer; }
.facts li:first-child { border-top: 0; }
.facts li:active { background: var(--accent-soft); }
.facts .q { font-size: 12.5px; font-weight: 700; color: var(--accent-ink); }
.facts .a { font-size: 14px; margin-top: 2px; }
.composer { display: flex; gap: 8px; padding: 10px 12px; padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--border); align-items: flex-end; }
.facts-btn { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); color: var(--muted); }
.facts-btn:hover { background: var(--accent-soft); color: var(--accent-ink); }
.facts-btn .ic { width: 19px; height: 19px; }
.composer textarea { flex: 1; resize: none; border-radius: 22px; padding: 10px 16px; max-height: 120px; font-size: 15px;
  background: var(--surface-2); border-color: var(--border); }
.send { border: 0; background: var(--accent); color: var(--on-accent); width: 42px; height: 42px; border-radius: 50%; flex: none;
  padding: 0; }
.send:hover { background: var(--accent-ink); color: var(--on-accent); }

/* dashboard */
.period { display: flex; gap: 6px; padding: 14px 14px 0; }
.period button { flex: 1; padding: 8px; font-size: 13px; }
.period button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 14px; }
.fcard { margin: 0 14px 12px; padding: 14px 16px; }
.fcard h3 { margin: 0 0 12px; font-size: 14px; font-weight: 800; color: var(--ink); }
.funnel { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.funnel li { display: grid; gap: 4px; }
.funnel .lbl { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; }
.funnel .lbl b { font-variant-numeric: tabular-nums; }
.funnel .conv { font-size: 12px; color: var(--muted); }
#photo form { text-align: right; margin-top: 8px; }
.toast { bottom: 88px; }

/* 07.11: превью вложений над полем ввода */
.mini-tray { padding: 10px 12px 0; margin: 0; background: var(--surface); border-top: 1px solid var(--border); }
.mini-tray + .composer { border-top: 0; }
@media (max-width: 380px) { .composer .facts-btn { width: 38px; height: 38px; } }
