:root {
  --bg: #f5f4f8;
  --panel: #ffffff;
  --line: #e8e6ef;
  --text: #1e1b2b;
  --muted: #7b7790;
  --accent: #e25d8a;
  --accent-soft: #fde9f0;
  --accent-dark: #c43f6d;
  --in: #f1f0f6;
  --out: #fff0f5;
  --sys: #8d89a3;
  --good: #16a37a;
  --warn: #e08a1e;
  --bad: #d64545;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(30, 27, 43, .06), 0 4px 16px rgba(30, 27, 43, .06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.btn {
  border: 1px solid var(--line); background: var(--panel); border-radius: 10px;
  padding: 7px 14px; font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { border-color: #cfcbdc; background: #faf9fc; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.danger { color: var(--bad); }
.btn.wide { width: 100%; padding: 11px; }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn {
  border: 0; background: transparent; width: 36px; height: 36px; border-radius: 10px;
  display: inline-grid; place-items: center; font-size: 18px; flex: none; cursor: pointer;
}
.icon-btn:hover { background: var(--in); }
input, select, textarea {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--panel); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  color: #fff; font-weight: 600; font-size: 15px; background: #b7b2c9;
}
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }

/* ---------- вход ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 20px; }
.login-card {
  width: 100%; max-width: 360px; background: var(--panel); border-radius: 20px; padding: 32px 28px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; text-align: center;
}
.login-card h1 { margin: 0; font-size: 22px; }
.login-card p { margin: 0 0 8px; }
.login-logo { font-size: 40px; }
.login-card input { padding: 11px 12px; }
.error { color: var(--bad); min-height: 18px; }

/* ---------- шапка ---------- */
#app { height: 100%; display: flex; flex-direction: column; }
.top {
  display: flex; align-items: center; gap: 14px; padding: 8px 16px; background: var(--panel);
  border-bottom: 1px solid var(--line); flex: none; min-height: 56px;
}
.brand { font-weight: 700; font-size: 17px; white-space: nowrap; }
.nav { display: flex; gap: 2px; }
.nav button { border: 0; background: none; padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.nav button.active { background: var(--accent-soft); color: var(--accent-dark); }
.nav button:hover:not(.active) { background: var(--in); }
.counters { display: flex; gap: 6px; margin-left: auto; }
.counter {
  border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 12px;
  color: var(--muted); white-space: nowrap; font-size: 13px;
}
.counter b { color: var(--text); margin-left: 3px; }
.counter.hot { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }
.counter.hot b { color: var(--accent-dark); }
.counter.new.hot { background: var(--accent); color: #fff; animation: pulse 1.6s infinite; }
.counter.new.hot b { color: #fff; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(226, 93, 138, .5); } 50% { box-shadow: 0 0 0 6px rgba(226, 93, 138, 0); } }

.shift { display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap; user-select: none; }
.shift input { display: none; }
.switch { width: 36px; height: 20px; border-radius: 999px; background: #d6d3e0; position: relative; transition: background .2s; }
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: left .2s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
.shift input:checked + .switch { background: var(--good); }
.shift input:checked + .switch::after { left: 18px; }

.me { position: relative; }
.me-btn { border: 0; background: none; display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 10px; white-space: nowrap; }
.me-btn:hover { background: var(--in); }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); background: var(--panel); border-radius: 12px;
  box-shadow: var(--shadow); border: 1px solid var(--line); padding: 6px; min-width: 240px; z-index: 30;
}
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 8px; }
.menu button:hover { background: var(--in); }

/* ---------- плашки новых ---------- */
.strip {
  display: flex; gap: 12px; align-items: stretch; padding: 10px 16px; flex: none;
  background: linear-gradient(90deg, #fff3f7, #fff8ec); border-bottom: 1px solid #f6d6e1;
}
.strip-title { font-weight: 700; color: var(--accent-dark); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; align-self: center; }
.strip-cards { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px; flex: 1; }
.new-card {
  flex: none; width: 250px; background: var(--panel); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow);
  border-left: 4px solid var(--accent); display: flex; flex-direction: column; gap: 4px; cursor: pointer;
}
.new-card:hover { transform: translateY(-1px); }
.new-card.late { border-left-color: var(--bad); background: #fff6f6; }
.new-card .nc-top { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.new-card .nc-wait { font-weight: 500; font-size: 12px; color: var(--muted); white-space: nowrap; }
.new-card.late .nc-wait { color: var(--bad); }
.new-card .nc-text { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.new-card .btn { align-self: flex-start; margin-top: 2px; }

/* ---------- диалоги ---------- */
.view { flex: 1; min-height: 0; }
.dialogs { display: grid; grid-template-columns: 340px 1fr 300px; }
.list-pane { border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; padding: 8px 8px 0; gap: 2px; overflow-x: auto; flex: none; }
.tabs button {
  border: 0; background: none; padding: 8px 10px; border-radius: 10px 10px 0 0; color: var(--muted);
  font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent;
}
.tabs button.active { color: var(--accent-dark); border-bottom-color: var(--accent); }
.tabs i { font-style: normal; background: var(--accent); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; margin-left: 2px; }
.tabs i:empty { display: none; }
.filters { padding: 8px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; flex: none; }
.filters input[type=search] { width: 100%; }
.filter-row { display: flex; gap: 6px; align-items: center; }
.filter-row select { flex: 1; min-width: 0; padding: 6px 8px; font-size: 13px; }
.chk { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 13px; cursor: pointer; }
.chk input { width: 16px; height: 16px; accent-color: var(--accent); }
.list { overflow-y: auto; flex: 1; }
.item { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #f3f2f7; cursor: pointer; position: relative; }
.item:hover { background: #faf9fc; }
.item.active { background: var(--accent-soft); }
.item .body { flex: 1; min-width: 0; }
.item .row1 { display: flex; gap: 6px; align-items: baseline; }
.item .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.item .time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.item .preview { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.item.unread .name, .item.unread .preview { color: var(--text); }
.item .row3 { display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap; align-items: center; }
.badge { background: var(--accent); color: #fff; border-radius: 999px; font-size: 12px; font-weight: 600; min-width: 20px; height: 20px; display: inline-grid; place-items: center; padding: 0 6px; }
.who { font-size: 11px; padding: 1px 7px; border-radius: 999px; color: #fff; white-space: nowrap; }
.who.none { background: #fff; color: var(--accent-dark); border: 1px solid var(--accent); }
.who.closed { background: #ecebf1; color: var(--muted); }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #eef3ff; color: #3755b8; white-space: nowrap; }
.wait { font-size: 11px; color: var(--warn); white-space: nowrap; }
.wait.late { color: var(--bad); font-weight: 600; }
.list-empty { padding: 40px 20px; text-align: center; color: var(--muted); }

.chat-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.empty { margin: auto; text-align: center; color: var(--muted); }
.empty-icon { font-size: 44px; margin-bottom: 8px; }
.chat { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--line); flex: none; }
.chat-title { flex: 1; min-width: 0; }
.chat-name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-sub { color: var(--muted); font-size: 12px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.chat-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.back, .info { display: none; }
.blocked-banner { background: #fff1f1; color: var(--bad); padding: 8px 14px; font-size: 13px; border-bottom: 1px solid #f7d4d4; }
.messages { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.day { align-self: center; color: var(--muted); font-size: 12px; margin: 10px 0 4px; background: var(--panel); padding: 2px 10px; border-radius: 999px; }
.msg { max-width: min(72%, 560px); padding: 8px 12px; border-radius: 16px; line-height: 1.4; word-wrap: break-word; white-space: pre-wrap; position: relative; }
.msg.in { background: var(--panel); align-self: flex-start; border-bottom-left-radius: 4px; box-shadow: 0 1px 1px rgba(0, 0, 0, .04); }
.msg.out { background: var(--out); align-self: flex-end; border-bottom-right-radius: 4px; border: 1px solid #f8dbe6; }
.msg.out.bot { background: #f3f2f8; border-color: #e8e6ef; }
.msg .meta { font-size: 11px; color: var(--muted); margin-top: 3px; text-align: right; white-space: nowrap; }
.msg .author { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.msg a { color: #3755b8; }
.msg img.media { max-width: 100%; max-height: 320px; border-radius: 10px; display: block; margin: 2px 0 4px; cursor: zoom-in; }
.msg img.sticker { max-width: 140px; }
.msg audio, .msg video { max-width: 100%; display: block; margin: 2px 0 4px; }
.file { display: flex; align-items: center; gap: 8px; background: rgba(0, 0, 0, .04); padding: 8px 10px; border-radius: 10px; margin: 2px 0 4px; text-decoration: none; color: inherit !important; }
.sys { align-self: center; color: var(--sys); font-size: 12px; text-align: center; padding: 2px 10px; max-width: 80%; }
.sys.new-req { color: var(--accent-dark); font-weight: 600; margin-top: 8px; }
.more { align-self: center; }

.composer { background: var(--panel); border-top: 1px solid var(--line); padding: 10px 12px; flex: none; position: relative; }
.composer-row { display: flex; gap: 6px; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; max-height: 200px; min-height: 40px; padding: 9px 12px; line-height: 1.4; }
.send { height: 40px; }
.attach-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.att { position: relative; flex: none; width: 84px; height: 84px; border-radius: 10px; background: var(--in); overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.att img, .att video { width: 100%; height: 100%; object-fit: cover; }
.att .doc { font-size: 26px; }
.att .play { position: absolute; color: #fff; font-size: 20px; text-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.att .att-name { position: absolute; bottom: 0; left: 0; right: 0; font-size: 10px; padding: 2px 4px; background: rgba(255, 255, 255, .85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(30, 27, 43, .65); color: #fff; font-size: 14px; line-height: 1; display: grid; place-items: center; }
.chat-pane.drop .messages { outline: 3px dashed var(--accent); outline-offset: -10px; background: var(--accent-soft); }
.msg video.media-video { max-width: 100%; max-height: 360px; border-radius: 10px; background: #000; }

.tpl-pop {
  position: absolute; bottom: calc(100% + 6px); left: 12px; width: min(440px, calc(100% - 24px)); max-height: 360px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 12px; padding: 6px; z-index: 10;
  display: flex; flex-direction: column; gap: 4px;
}
.tpl-pop #tpl-q { width: 100%; padding: 7px 10px; }
#tpl-items { overflow-y: auto; flex: 1; min-height: 0; }
.tpl-sec { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px 2px; }
.tpl-row { display: flex; align-items: center; border-radius: 8px; }
.tpl-row.active, .tpl-row:hover { background: var(--in); }
.tpl-pick { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 8px 10px; }
.tpl-pick small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-edit { border: 0; background: none; color: var(--muted); padding: 6px 10px; font-size: 15px; }
.tpl-edit:hover { color: var(--accent-dark); }
.tpl-empty { padding: 10px; }
.tpl-new { border: 0; background: none; color: var(--accent-dark); font-weight: 600; text-align: left; padding: 8px 10px; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; }

.card-pane { border-left: 1px solid var(--line); background: var(--panel); overflow-y: auto; }
#card { padding: 16px; display: flex; flex-direction: column; gap: 18px; }
.card-head { display: flex; gap: 12px; align-items: center; }
.card-head .avatar { width: 52px; height: 52px; font-size: 19px; }
.card-name { font-weight: 700; font-size: 16px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; word-break: break-all; }
.section-title { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 8px; }
.tags-box { display: flex; flex-wrap: wrap; gap: 6px; }
.tags-box .tag { font-size: 12px; padding: 3px 4px 3px 9px; display: inline-flex; align-items: center; gap: 2px; }
.tags-box .tag button { border: 0; background: none; color: #6b7fc4; padding: 0 4px; font-size: 14px; line-height: 1; }
.tag-input { display: flex; gap: 6px; margin-top: 8px; }
.tag-input input { flex: 1; min-width: 0; padding: 6px 8px; }
.note-form textarea { width: 100%; min-height: 64px; }
.note-form .btn { margin-top: 6px; }
.note { background: #fffbea; border: 1px solid #f4e7b5; border-radius: 10px; padding: 8px 10px; margin-top: 8px; font-size: 13px; white-space: pre-wrap; word-wrap: break-word; }
.note .note-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 4px; }
.note .note-meta button { border: 0; background: none; color: var(--muted); padding: 0; }

/* ---------- страницы админа ---------- */
.page { overflow-y: auto; padding: 20px 24px 40px; }
.page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 4px 0 16px; }
.page-head h2, .page-head h3 { margin: 0; }
.page-head h3 { margin-top: 24px; }
.page-head .btn { margin-left: auto; }
.page-head h3 + .btn { margin-top: 24px; }
.seg { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 2px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; color: var(--muted); }
.seg button.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.range { display: flex; gap: 6px; align-items: center; color: var(--muted); }
.range input { padding: 5px 8px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 18px; }
.tile { background: var(--panel); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.tile .v { font-size: 26px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tile .l { color: var(--muted); font-size: 12px; }
.tile.alert .v { color: var(--bad); }
.table-wrap { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid #f3f2f7; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table th.num { text-align: right; }
.person { display: flex; gap: 8px; align-items: center; }
.person a { color: inherit; font-weight: 600; text-decoration: none; }
.person a:hover { color: var(--accent-dark); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #cfcbdc; display: inline-block; flex: none; }
.dot.on { background: var(--good); }
.bad { color: var(--bad); font-weight: 600; }
.settings { display: flex; flex-direction: column; gap: 14px; max-width: 640px; background: var(--panel); padding: 18px; border-radius: var(--radius); box-shadow: var(--shadow); }
.settings label:not(.chk) { display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
.settings .chk { white-space: normal; font-size: 14px; align-items: flex-start; }
.settings .chk input { margin-top: 2px; flex: none; }
.settings .btn { align-self: flex-start; }
.tpl-list { display: flex; flex-direction: column; gap: 8px; max-width: 640px; }
.tpl-item { background: var(--panel); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); display: flex; gap: 10px; }
.tpl-item .tpl-body { flex: 1; min-width: 0; }
.tpl-item .tpl-text { color: var(--muted); white-space: pre-wrap; font-size: 13px; margin-top: 2px; }

/* ---------- модалки ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(30, 27, 43, .35); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--panel); border-radius: 18px; padding: 20px; width: 100%; max-width: 420px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; max-height: 90vh; overflow-y: auto; }
.modal h3 { margin: 0; }
.modal label { display: flex; flex-direction: column; gap: 5px; font-weight: 500; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.pick { display: flex; flex-direction: column; gap: 6px; }
.pick label { flex-direction: row; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 400; }
.pick label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pick input { accent-color: var(--accent); }
.pick .load { margin-left: auto; color: var(--muted); font-size: 12px; }
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .85); display: grid; place-items: center; z-index: 60; cursor: zoom-out; }
.lightbox img { max-width: 95vw; max-height: 95vh; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 70; max-width: 90vw; }
.toast.err { background: var(--bad); }

/* ---------- адаптив ---------- */
@media (max-width: 1250px) {
  .dialogs { grid-template-columns: 320px 1fr; }
  .card-pane { position: fixed; right: 0; top: 0; bottom: 0; width: min(340px, 92vw); z-index: 40; box-shadow: -8px 0 30px rgba(0, 0, 0, .12); transform: translateX(105%); transition: transform .2s; }
  .card-pane.open { transform: none; }
  .info { display: inline-grid; }
  .counter:not(.new) { display: none; }
}
@media (max-width: 860px) {
  .top { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
  .brand span, .shift-label, #me-name { display: none; }
  .nav { order: 5; width: 100%; overflow-x: auto; }
  .counters { margin-left: auto; }
  .strip { padding: 8px 10px; }
  .strip-title { display: none; }
  .new-card { width: 210px; }
  .dialogs { grid-template-columns: 1fr; }
  .dialogs.chat-open .list-pane { display: none; }
  .dialogs:not(.chat-open) .chat-pane { display: none; }
  .back { display: inline-grid; font-size: 28px; }
  .msg { max-width: 86%; }
  .chat-head { flex-wrap: wrap; padding: 8px 10px; }
  .chat-actions { width: 100%; justify-content: flex-start; order: 5; }
  .composer textarea::placeholder { color: transparent; }
  .page { padding: 14px; }
}

/* ---------- режим работы ---------- */
.steps { margin: 0; padding-left: 18px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
fieldset.notify .tz { flex-wrap: wrap; }
.hours-chip { background: #eef0ff; color: #4a4fb0; border-radius: 999px; padding: 5px 12px; font-size: 13px; white-space: nowrap; }
fieldset.hours { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 14px; margin: 0; }
fieldset.hours legend { padding: 0 6px; }
.hours-body { display: flex; flex-direction: column; gap: 12px; }
.hours-body.disabled { opacity: .45; pointer-events: none; }
.hours-body label.tz { flex-direction: row !important; align-items: center; gap: 10px !important; }
.days { display: flex; flex-direction: column; gap: 6px; }
.day-row { display: flex; align-items: center; gap: 8px; }
.day-row .chk { width: 140px; font-size: 14px; }
.day-row input[type=time] { padding: 5px 8px; }
.day-row > .muted { display: none; }
.day-row.off input[type=time] { display: none; }
.day-row.off > .muted { display: inline; }

/* ---------- плашка новых в свёрнутом виде (телефон, открыт диалог) ---------- */
.strip-mini { display: none; border: 0; background: none; color: var(--accent-dark); font-weight: 600; padding: 2px 0; text-align: left; width: 100%; }

@media (max-width: 860px) {
  .hours-chip { order: 4; font-size: 12px; padding: 3px 10px; }
  body:has(.dialogs.chat-open) .strip:not(.expanded) .strip-cards { display: none; }
  body:has(.dialogs.chat-open) .strip:not(.expanded) .strip-mini { display: block; }
  body:has(.dialogs.chat-open) .strip { padding: 6px 12px; }
  .strip { flex-direction: column; gap: 6px; }
  .messages { padding: 12px 10px; }
  .composer { padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
  .composer-row { gap: 2px; }
  .send { padding: 0 12px; }
  .att { width: 72px; height: 72px; }
  .tpl-pop { left: 6px; width: calc(100% - 12px); max-height: 55vh; }
  .tpl-edit { padding: 10px 14px; }
  .day-row .chk { width: 120px; }
  .table td, .table th { padding: 8px; }
  .modal { padding: 16px; }
  input, select, textarea { font-size: 16px; } /* иначе iPhone приближает страницу при вводе */
  .top { padding-top: calc(8px + env(safe-area-inset-top)); }
}

/* узкие телефоны: ничего не вылезает за край */
.list-pane, .chat-pane { min-width: 0; }
@media (max-width: 860px) {
  .dialogs { grid-template-columns: minmax(0, 1fr); }
  .filter-row select { font-size: 14px; }
  .filter-row .chk { font-size: 13px; }
}
