:root {
  --bg: #f6f5f1;
  --panel: #ffffff;
  --ink: #24302b;
  --muted: #7b8a83;
  --line: #e2e0d8;
  --accent: #3f7d64;
  --accent-soft: #e8f1ec;
  --danger: #b3453a;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(36, 48, 43, .06), 0 6px 20px rgba(36, 48, 43, .05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171a19;
    --panel: #1f2422;
    --ink: #e7ece9;
    --muted: #93a19a;
    --line: #2e3634;
    --accent: #79b79a;
    --accent-soft: #23302a;
    --danger: #d98a80;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: .9em; }
.error { color: var(--danger); margin-top: 8px; min-height: 1.2em; }
code { background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; }

/* ---------- вход ---------- */
.login-wrap { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login-card {
  background: var(--panel); padding: 32px; border-radius: var(--radius);
  box-shadow: var(--shadow); width: 100%; max-width: 360px;
}
.login-card h1 { margin: 0 0 4px; font-size: 24px; }
.login-card p { margin: 0 0 20px; }

/* ---------- каркас ---------- */
#app { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--panel); border-right: 1px solid var(--line);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 8px;
  position: sticky; top: 0; height: 100vh;
}
.brand { font-weight: 600; font-size: 17px; padding: 0 10px 12px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  padding: 9px 12px; border-radius: 8px; cursor: pointer;
  color: var(--ink); text-decoration: none; display: flex;
  justify-content: space-between; align-items: center;
}
.sidebar nav a:hover { background: var(--accent-soft); }
.sidebar nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sidebar-foot { margin-top: auto; padding: 0 10px; }
.bot-state { font-size: 13px; margin-bottom: 10px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot.on { background: #4caf7d; } .dot.off { background: #c0554a; }

main { padding: 26px 30px; max-width: 1200px; }
h2 { margin: 0 0 18px; font-size: 22px; }
h3 { margin: 22px 0 10px; font-size: 16px; }

/* ---------- элементы ---------- */
button {
  background: var(--accent); color: #fff; border: 0; padding: 9px 16px;
  border-radius: 8px; cursor: pointer; font-size: 14px; font-family: inherit;
}
button:hover { filter: brightness(1.07); }
button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--line); }
button.link { background: none; color: var(--muted); padding: 0; }
button:disabled { opacity: .5; cursor: not-allowed; }

input, textarea, select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--bg); color: var(--ink);
  font: inherit; font-size: 14px;
}
textarea { resize: vertical; }
label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
label input, label textarea, label select { margin-top: 5px; }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin-bottom: 18px;
}
details.panel summary { cursor: pointer; font-weight: 600; }
details.panel[open] summary { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 16px; }
.form-grid .wide, .form-grid h3, .form-grid .row, .form-grid p { grid-column: 1 / -1; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.row > .panel { flex: 1 1 320px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card b { display: block; font-size: 26px; font-weight: 600; }

.list { display: flex; flex-direction: column; gap: 10px; }
.item {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 16px;
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
}
.item .grow { flex: 1; min-width: 0; }
.badge {
  background: var(--accent); color: #fff; border-radius: 10px;
  padding: 1px 7px; font-size: 12px;
}

/* ---------- чаты ---------- */
.chat-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; height: calc(100vh - 100px); }
.chat-list { display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.chat-list > div { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.dialog {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; cursor: pointer;
}
.dialog:hover { border-color: var(--accent); }
.dialog.active { background: var(--accent-soft); border-color: var(--accent); }
.dialog .name { font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.dialog .snippet {
  color: var(--muted); font-size: 12.5px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

.chat-pane {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden;
}
.chat-header { padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 600; }
.messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 74%; padding: 9px 13px; border-radius: 12px; white-space: pre-wrap; word-break: break-word; }
.msg.in { background: var(--accent-soft); align-self: flex-start; border-bottom-left-radius: 3px; }
.msg.out { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 3px; }
.msg .time { display: block; font-size: 11px; opacity: .65; margin-top: 3px; }
.compose { border-top: 1px solid var(--line); padding: 12px 16px; }
.compose-actions { display: flex; gap: 8px; margin-top: 8px; }

/* ---------- календарь ---------- */
.calendar { display: flex; flex-direction: column; gap: 14px; }
.day { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.day h4 { margin: 0 0 10px; font-size: 15px; }
.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slot {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px;
  font-size: 13px; display: flex; flex-direction: column; gap: 3px; min-width: 130px;
}
.slot.free { border-style: dashed; }
.slot.booked { background: var(--accent-soft); border-color: var(--accent); }
.slot.closed { opacity: .5; }
.slot .who { font-weight: 600; }
.slot .acts { display: flex; gap: 6px; margin-top: 4px; }
.slot .acts button { padding: 3px 8px; font-size: 12px; }
.weekdays { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.weekdays label {
  margin: 0; display: flex; align-items: center; gap: 5px;
  border: 1px solid var(--line); padding: 6px 10px; border-radius: 8px; cursor: pointer;
}
.weekdays input { width: auto; margin: 0; }

/* ---------- тост ---------- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 11px 20px;
  border-radius: 10px; box-shadow: var(--shadow); z-index: 50; max-width: 90vw;
}
.toast.err { background: var(--danger); color: #fff; }

@media (max-width: 860px) {
  #app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  main { padding: 18px; }
}

/* ---------- мини-календарь ---------- */
.cal-top { display: grid; grid-template-columns: minmax(280px, 340px) 1fr; gap: 16px; align-items: start; }
.mini-panel { padding: 16px; }
.mini-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.mini-head button { padding: 4px 12px; }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.mini-wd { text-align: center; font-size: 11px; color: var(--muted); padding-bottom: 4px; }
.mini-day {
  aspect-ratio: 1; border: 1px solid transparent; border-radius: 7px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; user-select: none; font-size: 13px; line-height: 1;
}
.mini-day:hover { border-color: var(--accent); }
.mini-day .marks { display: flex; gap: 3px; margin-top: 3px; height: 11px; font-size: 10px; }
.mini-day .marks b { color: var(--accent); font-weight: 700; }
.mini-day .marks i { color: var(--muted); font-style: normal; }
.mini-day.has-booked { background: var(--accent-soft); }
.mini-day.today .n { text-decoration: underline; font-weight: 700; }
.mini-day.picked { background: var(--accent); color: #fff; }
.mini-day.picked .marks b, .mini-day.picked .marks i { color: #fff; }
.mini-total { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }

/* ---------- пометки и диалоги ---------- */
.tag { font-size: 11px; padding: 1px 6px; border-radius: 20px; vertical-align: middle; }
.tag.first { background: var(--accent-soft); color: var(--accent); }
.tag.repeat { background: var(--accent); color: #fff; }
.slot .note {
  font-size: 12px; color: var(--muted); border-left: 2px solid var(--line);
  padding-left: 6px; margin-top: 2px; max-width: 220px;
}
.slot { max-width: 260px; }

dialog {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  background: var(--panel); color: var(--ink); max-width: 460px; width: 92vw;
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(0, 0, 0, .45); }
label.inline { display: flex; align-items: center; gap: 8px; }
label.inline input { width: auto; margin: 0; }

@media (max-width: 860px) {
  .cal-top { grid-template-columns: 1fr; }
}

/* ---------- легенда мини-календаря ---------- */
.mini-legend {
  display: flex; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--muted);
  align-items: center;
}
.mini-legend b { font-size: 11px; padding: 1px 5px; border-radius: 4px; margin-right: 4px; }
.lg-booked { background: var(--accent); color: #fff; }
.lg-free { background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 400; }
/* Записи — залитой плашкой, свободные — контуром: различимо не только цветом */
.mini-day .marks b {
  background: var(--accent); color: #fff; border-radius: 4px; padding: 0 4px; font-weight: 700;
}
.mini-day .marks i {
  border: 1px solid var(--line); border-radius: 4px; padding: 0 3px;
  color: var(--muted); font-style: normal;
}
.mini-day.picked .marks b { background: #fff; color: var(--accent); }
.mini-day.picked .marks i { border-color: rgba(255,255,255,.6); color: #fff; }

/* ---------- вкладка «Записи» ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button.active { background: var(--accent); color: #fff; border-color: transparent; }
.appt-day { margin-bottom: 18px; }
.appt-day-head {
  font-weight: 600; font-size: 14px; margin-bottom: 8px;
  padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.appt {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 8px;
  display: flex; gap: 14px; align-items: flex-start;
}
.appt-time {
  font-size: 17px; font-weight: 600; min-width: 58px;
  color: var(--accent); padding-top: 1px;
}
.appt-name { font-weight: 600; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.appt-note {
  font-size: 13px; color: var(--muted); margin-top: 5px;
  border-left: 2px solid var(--line); padding-left: 8px;
}
.appt-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.appt-acts button { padding: 4px 10px; font-size: 12.5px; }

@media (max-width: 720px) {
  .appt { flex-wrap: wrap; }
  .appt-acts { width: 100%; justify-content: flex-start; }
}

/* ---------- цветовые темы ---------- */
:root[data-theme="ocean"]    { --accent: #2f6f9f; --accent-soft: #e6eff6; }
:root[data-theme="sand"]     { --accent: #b4693f; --accent-soft: #f7ece5; }
:root[data-theme="lavender"] { --accent: #6c5aa8; --accent-soft: #eeeaf7; }
:root[data-theme="graphite"] { --accent: #4a5560; --accent-soft: #eaeef1; }

@media (prefers-color-scheme: dark) {
  :root[data-theme="ocean"]    { --accent: #6fb0da; --accent-soft: #1d2b36; }
  :root[data-theme="sand"]     { --accent: #dd9b74; --accent-soft: #332520; }
  :root[data-theme="lavender"] { --accent: #a394de; --accent-soft: #262133; }
  :root[data-theme="graphite"] { --accent: #9aa7b4; --accent-soft: #232a30; }
}

.themes { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.theme-chip {
  background: transparent; color: var(--ink); border: 1px solid var(--line);
  display: flex; align-items: center; gap: 7px; padding: 7px 12px; font-size: 13px;
}
.theme-chip.active { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.theme-chip .swatch { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }

/* ---------- вложения и быстрые ответы ---------- */
.quick-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.quick-bar .quick { padding: 4px 10px; font-size: 12.5px; }
.msg-media {
  display: block; max-width: 260px; max-height: 260px; width: auto;
  border-radius: 8px; margin-bottom: 6px; cursor: pointer;
}
.msg-file {
  display: inline-block; margin-bottom: 4px; text-decoration: none;
  color: inherit; border-bottom: 1px dashed currentColor;
}
.msg.out .msg-file { color: #fff; }

/* ---------- диаграмма загрузки ---------- */
/* Серый «свободно» проверен валидатором палитры: отделяется от акцента любой
   темы (ΔE 19.8+ и при дальтонизме), но сам к фону контрастнее 3:1 не тянет —
   поэтому у сегмента есть обводка, а числа продублированы в подсказке и таблице. */
:root { --chart-free: #a9b2ae; --chart-free-stroke: #8b958f; }
@media (prefers-color-scheme: dark) {
  :root { --chart-free: #5c6864; --chart-free-stroke: #77837e; }
}

.chart-panel { position: relative; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.chart { width: 100%; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .hit { cursor: crosshair; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 6px; }
.lg-swatch { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.lg-swatch.booked { background: var(--accent); }
.lg-swatch.free { background: var(--chart-free); border: 1px solid var(--chart-free-stroke); }

.chart-tip {
  position: absolute; z-index: 5; pointer-events: none;
  background: var(--ink); color: var(--bg); font-size: 12px; line-height: 1.35;
  padding: 6px 9px; border-radius: 7px; white-space: nowrap;
}

.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
.mini-table th, .mini-table td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.mini-table th { color: var(--muted); font-weight: 500; }
.mini-table tr.sum td { font-weight: 600; border-bottom: 0; }

/* ---------- история клиента ---------- */
#history-dialog { max-width: 520px; }
#history-body { max-height: 60vh; overflow-y: auto; }
.hist-row { padding: 9px 0; border-bottom: 1px solid var(--line); }
.hist-row:last-child { border-bottom: 0; }
.hist-row.off { opacity: .55; }
.hist-note {
  font-size: 13px; color: var(--muted); margin-top: 4px;
  border-left: 2px solid var(--line); padding-left: 8px;
}
.chat-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.chat-header button { padding: 4px 10px; font-size: 12.5px; }

/* ---------- сотрудники ---------- */
.who { font-size: 12.5px; margin-bottom: 8px; line-height: 1.3; }
.who .role { display: block; color: var(--muted); font-size: 11.5px; }
.item.off { opacity: .55; }
.item select { width: auto; min-width: 130px; padding: 5px 8px; font-size: 13px; }
.item button { padding: 5px 10px; font-size: 12.5px; }
.role-row { display: flex; gap: 10px; align-items: baseline; padding: 4px 0; flex-wrap: wrap; }
.role-row b { min-width: 120px; }

/* ---------- специалисты ---------- */
.spec-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
}
.spec-line { font-size: 12px; color: var(--muted); display: flex; align-items: center; }
.slot .spec-line { margin-top: 2px; }

/* ---------- журнал ---------- */
.audit-row { align-items: flex-start; }
.audit-time { font-size: 12px; color: var(--muted); min-width: 96px; padding-top: 2px; }

/* ---------- признаки клиента ---------- */
/* Тон подсказывает смысл, но не несёт его в одиночку: рядом всегда текст,
   поэтому метки читаются и без различения цветов. */
.tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.tag.tone-good { background: var(--accent-soft); color: var(--accent); }
.tag.tone-info { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.tag.tone-warn { background: #f6ead3; color: #8a5a11; }
.tag.tone-bad  { background: #f6dcd8; color: #93342a; }

@media (prefers-color-scheme: dark) {
  .tag.tone-warn { background: #3a3120; color: #e2b96b; }
  .tag.tone-bad  { background: #3b2523; color: #e79a90; }
}

/* ---------- деньги ---------- */
.money { font-size: 12.5px; font-weight: 600; }
.money.paid, .card b.paid { color: var(--accent); }
.money.due, .card b.due, td.due { color: var(--danger); }
.mini-table td b { font-weight: 600; }

/* ---------- счётчик символов ---------- */
.counter { font-size: 11.5px; color: var(--muted); text-align: right; margin: -8px 0 10px; }
.counter.near { color: #8a5a11; }
@media (prefers-color-scheme: dark) { .counter.near { color: #e2b96b; } }

/* ---------- календарь по специалистам ---------- */
.day-columns {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px;
}
.day-col { border-left: 2px solid var(--line); padding-left: 10px; }
.col-head {
  display: flex; align-items: center; gap: 7px; margin-bottom: 8px;
  font-size: 13px; padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.day-col .slots { flex-direction: column; flex-wrap: nowrap; }
.day-col .slot { max-width: none; width: 100%; }

/* ---------- история клиента ---------- */
.hist-block { margin: 16px 0 8px; }
.hist-block h4 { margin: 0 0 8px; font-size: 14px; }
.note-form { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 10px; }
.note-form textarea { flex: 1; }
/* В узкой форме заметки счётчик только мешает — ограничение всё равно
   держит maxlength у самого поля. */
.note-form .counter { display: none; }
.note-del { font-size: 12px; float: right; }

/* ---------- отзывы ---------- */
.stars { color: var(--accent); letter-spacing: 1px; }

/* ---------- ссылки на календарь ---------- */
.ics-url { font-size: 12px; margin-top: 6px; font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ---------- поддержка и инструкции ---------- */

.support-search { margin: 4px 0 14px; }
.support-search input { width: 100%; max-width: 420px; }

.doc-layout { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .doc-layout { grid-template-columns: 1fr; } }

.doc-list { display: flex; flex-direction: column; gap: 6px; }
.doc-item {
  text-align: left; background: none; border: 1px solid transparent;
  border-radius: 10px; padding: 9px 11px; cursor: pointer; color: inherit;
  display: flex; flex-direction: column; gap: 2px; font: inherit;
}
.doc-item:hover { background: rgba(127, 127, 127, .08); }
.doc-item.active { background: rgba(127, 127, 127, .12); border-color: rgba(127, 127, 127, .25); }
.doc-item .muted { font-size: 12px; }

.doc-body { max-width: 760px; line-height: 1.65; }
.doc-body h3 { margin-top: 0; }
.doc-body h4 { margin: 22px 0 8px; font-size: 15px; }
.doc-body ol, .doc-body ul { padding-left: 20px; }
.doc-body li { margin: 4px 0; }
.doc-body code {
  background: rgba(127, 127, 127, .14); padding: 1px 5px; border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
}
.doc-tip, .doc-warn {
  border-left: 3px solid; padding: 9px 12px; border-radius: 0 8px 8px 0; margin: 14px 0;
}
.doc-tip { border-color: #4bb3a5; background: rgba(75, 179, 165, .1); }
.doc-warn { border-color: #d8a24a; background: rgba(216, 162, 74, .12); }
.doc-foot { margin-top: 26px; padding-top: 14px; border-top: 1px solid rgba(127, 127, 127, .25); }

/* Макет переписки с BotFather. */
.doc-chat {
  border: 1px solid rgba(127, 127, 127, .25); border-radius: 12px;
  padding: 10px; margin: 14px 0; background: rgba(127, 127, 127, .05);
}
.doc-chat-top {
  display: flex; align-items: center; gap: 8px; font-weight: 600;
  padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid rgba(127, 127, 127, .2);
}
.doc-ava {
  width: 26px; height: 26px; border-radius: 50%; background: #4bb3a5; color: #08120f;
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
}
.doc-msg {
  max-width: 82%; padding: 8px 11px; border-radius: 12px; margin: 6px 0; font-size: 14px;
  background: rgba(127, 127, 127, .12);
}
.doc-msg.out { margin-left: auto; background: rgba(75, 179, 165, .18); }
.doc-token {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  word-break: break-all; display: inline-block; padding: 3px 6px;
  background: rgba(127, 127, 127, .18); border-radius: 6px; margin-top: 4px;
}

/* Макет фрагмента кабинета. */
.doc-shot {
  border: 1px solid rgba(127, 127, 127, .3); border-radius: 12px;
  overflow: hidden; margin: 14px 0;
}
.doc-shot-top {
  padding: 8px 12px; font-size: 13px; font-weight: 600;
  background: rgba(127, 127, 127, .12); border-bottom: 1px solid rgba(127, 127, 127, .2);
}
.doc-shot-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.doc-shot-body label { font-size: 12px; opacity: .75; }
.doc-input {
  border: 1px solid rgba(127, 127, 127, .35); border-radius: 8px; padding: 7px 10px;
  font-size: 13px; background: rgba(127, 127, 127, .06);
}
.doc-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.doc-btn {
  align-self: flex-start; background: #4bb3a5; color: #08120f; font-weight: 600;
  padding: 7px 14px; border-radius: 8px; font-size: 13px;
}
.doc-hint { font-size: 12px; opacity: .7; }
.doc-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.doc-row span { min-width: 190px; opacity: .75; }
.doc-row .doc-input { flex: 1; max-width: 160px; }

/* Обращения. */
.ticket {
  display: block; width: 100%; text-align: left; font: inherit; color: inherit;
  background: none; border: 1px solid rgba(127, 127, 127, .25); border-radius: 10px;
  padding: 11px 13px; margin-bottom: 8px; cursor: pointer;
}
.ticket:hover { background: rgba(127, 127, 127, .07); }
.ticket-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.thread { display: flex; flex-direction: column; gap: 10px; max-height: 360px; overflow: auto; margin: 12px 0; }
.thread-msg { padding: 9px 12px; border-radius: 10px; max-width: 85%; font-size: 14px; }
.thread-msg.them { background: rgba(75, 179, 165, .14); align-self: flex-start; }
.thread-msg.me { background: rgba(127, 127, 127, .12); align-self: flex-end; }
.thread-msg .muted { font-size: 11px; display: block; margin-bottom: 3px; }
.notice { padding: 10px 13px; border-radius: 8px; background: rgba(127, 127, 127, .1); margin-bottom: 12px; }
.notice.err { background: rgba(217, 96, 95, .14); }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.row-end { display: flex; justify-content: flex-end; margin-top: 12px; }

/* Метка канала в списке диалогов. */
.chan {
  display: inline-block; font-size: 10px; font-weight: 700; line-height: 1;
  padding: 2px 4px; border-radius: 4px; margin-right: 5px; vertical-align: middle;
}
.chan.vk { background: #0077ff; color: #fff; }
