/* Сайт поддержки GoSwap. Токены цвета — светлая и тёмная тема. */
:root {
  --bg: #f3f4f7; --panel: #ffffff; --panel-2: #f7f8fa; --hover: #f1f3f6; --active: #e9effe;
  --ink: #14161b; --dim: #626a77; --faint: #99a0ab; --line: #e5e7eb; --line-2: #eef0f3;
  --accent: #2563eb; --accent-2: #1d4ed8; --accent-ink: #ffffff; --accent-soft: #e8efff;
  --in-bg: #eef0f4; --in-ink: #14161b; --out-bg: #2563eb; --out-ink: #ffffff; --out-dim: rgba(255,255,255,.72);
  --note-bg: #fff6d9; --note-line: #f0d27c; --note-ink: #5b4708;
  --ok: #15803d; --ok-soft: #e3f5e9; --warn: #b45309; --warn-soft: #fff1dc; --bad: #c81e1e; --bad-soft: #fdeaea;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 10px 30px rgba(16,24,40,.10);
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1014; --panel: #161920; --panel-2: #1b1f27; --hover: #1f242d; --active: #1e2a44;
    --ink: #e7e9ee; --dim: #9aa2af; --faint: #6d7582; --line: #262b35; --line-2: #20252e;
    --accent: #4f86ff; --accent-2: #3b74f0; --accent-ink: #ffffff; --accent-soft: #1d2a47;
    --in-bg: #232833; --in-ink: #e7e9ee; --out-bg: #2f68e6; --out-ink: #ffffff; --out-dim: rgba(255,255,255,.7);
    --note-bg: #332b14; --note-line: #5f4f1f; --note-ink: #f1dc9b;
    --ok: #4ade80; --ok-soft: #13301f; --warn: #fbbf24; --warn-soft: #33270f; --bad: #f87171; --bad-soft: #3a1717;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1014; --panel: #161920; --panel-2: #1b1f27; --hover: #1f242d; --active: #1e2a44;
  --ink: #e7e9ee; --dim: #9aa2af; --faint: #6d7582; --line: #262b35; --line-2: #20252e;
  --accent: #4f86ff; --accent-2: #3b74f0; --accent-ink: #ffffff; --accent-soft: #1d2a47;
  --in-bg: #232833; --in-ink: #e7e9ee; --out-bg: #2f68e6; --out-ink: #ffffff; --out-dim: rgba(255,255,255,.7);
  --note-bg: #332b14; --note-line: #5f4f1f; --note-ink: #f1dc9b;
  --ok: #4ade80; --ok-soft: #13301f; --warn: #fbbf24; --warn-soft: #33270f; --bad: #f87171; --bad-soft: #3a1717;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--dim); }
.small { font-size: 12px; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--dim); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- кнопки и поля */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel); cursor: pointer; white-space: nowrap; font-weight: 500;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.wide { width: 100%; height: 42px; font-size: 15px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  border: 0; background: transparent; color: var(--dim); cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn.on { color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 12px; color: var(--dim); font-weight: 500; }
.input, textarea.input, select.input {
  width: 100%; min-height: 36px; padding: 7px 11px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel); outline: none;
}
textarea.input { resize: vertical; min-height: 90px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
kbd {
  font: 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 2px 5px; border-radius: 5px;
  border: 1px solid var(--line); border-bottom-width: 2px; background: var(--panel-2); color: var(--dim);
}
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

/* ---------- каркас */
.app { display: grid; grid-template-columns: 64px 340px minmax(0, 1fr) 300px; height: 100vh; }
.app.no-card { grid-template-columns: 64px 340px minmax(0, 1fr) 0; }
.app.page { grid-template-columns: 64px minmax(0, 1fr); }

.rail {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 0;
  background: var(--panel); border-right: 1px solid var(--line);
}
.logo {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 10px;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 18px; letter-spacing: -.5px;
}
.nav {
  position: relative; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  color: var(--dim); border: 0; background: transparent; cursor: pointer;
}
.nav svg.i { width: 21px; height: 21px; }
.nav:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.nav.on { background: var(--accent-soft); color: var(--accent); }
.nav .dot {
  position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center;
  border: 2px solid var(--panel);
}
.rail .spacer { flex: 1; }
.me {
  width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; margin-top: 6px;
  display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 14px;
}
.conn { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin: 6px 0 2px; }
.conn.off { background: var(--bad); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* tooltip для рейки */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: #111318; color: #fff; padding: 5px 9px; border-radius: 7px; font-size: 12px; white-space: nowrap;
  pointer-events: none; z-index: 50; box-shadow: var(--shadow);
}

/* ---------- список диалогов */
.list { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-right: 1px solid var(--line); }
.list-head { padding: 14px 14px 10px; }
.list-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.list-title h2 { margin: 0; font-size: 18px; letter-spacing: -.2px; }
.search { position: relative; }
.search svg.i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 16px; height: 16px; }
.search input {
  width: 100%; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2);
  padding: 0 34px 0 32px; outline: none;
}
.search input:focus { border-color: var(--accent); background: var(--panel); box-shadow: 0 0 0 3px var(--accent-soft); }
.search .clear { position: absolute; right: 4px; top: 4px; width: 28px; height: 28px; }
.tabs { display: flex; gap: 2px; padding: 0 10px 8px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px;
  border: 0; background: transparent; color: var(--dim); cursor: pointer; font-weight: 500; font-size: 13px;
}
.tab:hover { background: var(--hover); color: var(--ink); }
.tab.on { background: var(--accent-soft); color: var(--accent); }
.tab .n { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 9px; background: var(--line-2); color: var(--dim); }
.tab.on .n { background: var(--accent); color: #fff; }
.tab .n.hot { background: var(--bad); color: #fff; }
.items { flex: 1; overflow-y: auto; padding: 6px; }
.empty { padding: 40px 20px; text-align: center; color: var(--dim); }
.empty .big { font-size: 34px; margin-bottom: 8px; }
.item {
  display: flex; gap: 11px; padding: 10px 10px; border-radius: 11px; color: inherit; cursor: pointer;
  position: relative;
}
.item:hover { background: var(--hover); text-decoration: none; }
.item.on { background: var(--active); }
.item-main { flex: 1; min-width: 0; }
.row1 { display: flex; align-items: center; gap: 6px; }
.nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row1 .flag { font-size: 12px; }
.row1 .time { margin-left: auto; font-size: 12px; color: var(--faint); flex: none; }
.row2 { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.pv { color: var(--dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.pv .who { color: var(--faint); }
.badge {
  flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent);
  color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.row3 { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 6px;
  font-size: 11.5px; font-weight: 600; background: var(--line-2); color: var(--dim); white-space: nowrap;
}
.chip svg.i { width: 12px; height: 12px; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.acc { background: var(--accent-soft); color: var(--accent); }
.more-row { padding: 8px; text-align: center; }

.ava {
  width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 16px; letter-spacing: -.3px; user-select: none;
}
.ava.sm { width: 34px; height: 34px; font-size: 14px; }
.ava.lg { width: 72px; height: 72px; font-size: 28px; }

/* ---------- переписка */
.thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); position: relative; }
.t-head {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: 62px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.t-who { min-width: 0; flex: 1; }
.t-name { font-weight: 650; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.t-name .nm { font-weight: 650; }
.t-sub { font-size: 12.5px; color: var(--dim); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.t-sub .sep { color: var(--faint); }
.copy { border: 0; background: none; color: var(--dim); cursor: pointer; padding: 0 2px; font: inherit; }
.copy:hover { color: var(--accent); }
.t-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.back { display: none; }

.t-body { flex: 1; overflow-y: auto; padding: 18px 22px 10px; display: flex; flex-direction: column; gap: 3px; }
.day { align-self: center; margin: 14px 0 8px; font-size: 12px; font-weight: 600; color: var(--dim);
  background: var(--panel); border: 1px solid var(--line); padding: 3px 11px; border-radius: 20px; }
.m { display: flex; flex-direction: column; max-width: min(620px, 78%); }
.m.in, .m.bot { align-self: flex-start; }
.m.out, .m.note { align-self: flex-end; align-items: flex-end; }
.m.sys { align-self: center; max-width: 90%; }
.m.gap { margin-top: 10px; }
.author { font-size: 12px; color: var(--dim); margin: 0 6px 3px; font-weight: 500; }
.bubble {
  position: relative; padding: 8px 12px 6px; border-radius: 16px; background: var(--in-bg); color: var(--in-ink);
  white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; box-shadow: 0 1px 1px rgba(0,0,0,.04);
}
.m.in .bubble { border-bottom-left-radius: 6px; }
.m.out .bubble { background: var(--out-bg); color: var(--out-ink); border-bottom-right-radius: 6px; }
.m.out .bubble a { color: #fff; text-decoration: underline; }
.m.note .bubble { background: var(--note-bg); color: var(--note-ink); border: 1px dashed var(--note-line); border-bottom-right-radius: 6px; }
.m.bot .bubble { background: var(--panel); border: 1px solid var(--line); }
.m.sys .bubble {
  background: transparent; box-shadow: none; color: var(--dim); font-size: 12px; padding: 4px 10px; text-align: center;
}
.meta { display: inline-flex; gap: 5px; align-items: center; float: right; margin: 6px 0 -2px 12px; font-size: 11px; color: var(--faint); white-space: nowrap; }
.m.out .meta { color: var(--out-dim); }
.m.note .meta { color: color-mix(in srgb, var(--note-ink) 65%, transparent); }
.m.fail .bubble { background: var(--bad-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); }
.m.fail .meta { color: var(--bad); }
.fail-note { font-size: 12px; color: var(--bad); margin: 3px 6px 0; display: flex; gap: 5px; align-items: center; }
.legacy { font-size: 11px; color: var(--faint); margin: 2px 6px 0; }
.media { margin: 2px -6px 6px; }
.media img.ph { display: block; max-width: 100%; max-height: 340px; border-radius: 11px; cursor: zoom-in; background: var(--line-2); min-width: 120px; min-height: 80px; object-fit: cover; }
.media img.stk { width: 140px; height: 140px; object-fit: contain; background: transparent; }
.media video { display: block; max-width: 100%; max-height: 340px; border-radius: 11px; background: #000; }
.media video.round { width: 220px; height: 220px; border-radius: 50%; object-fit: cover; }
.media audio { display: block; width: 280px; max-width: 100%; }
.doc {
  display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; margin: 2px -4px 6px;
  background: rgba(127,127,127,.12); color: inherit; min-width: 220px;
}
.doc:hover { text-decoration: none; background: rgba(127,127,127,.2); }
.doc .ic { width: 36px; height: 36px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.m.out .doc .ic { background: rgba(255,255,255,.22); }
.doc .fn { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
.doc .fs { font-size: 12px; opacity: .75; }
.load-more { align-self: center; margin-bottom: 10px; }
.new-below {
  position: absolute; right: 24px; bottom: 150px; z-index: 5; box-shadow: var(--shadow); border-radius: 20px;
}
.placeholder { flex: 1; display: grid; place-items: center; text-align: center; color: var(--dim); padding: 30px; }
.placeholder .big { width: 76px; height: 76px; border-radius: 22px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin: 0 auto 16px; }
.placeholder .big svg.i { width: 36px; height: 36px; }
.placeholder h3 { margin: 0 0 6px; color: var(--ink); font-size: 17px; }
.hotkeys { margin-top: 18px; display: grid; grid-template-columns: auto auto; gap: 8px 14px; font-size: 13px; text-align: left; justify-content: center; }

/* ---------- поле ответа */
.composer { background: var(--panel); border-top: 1px solid var(--line); padding: 8px 14px 12px; }
.c-banner {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 7px 10px; border-radius: 9px; margin-bottom: 8px;
  background: var(--warn-soft); color: var(--warn); font-weight: 500;
}
.c-banner.bad { background: var(--bad-soft); color: var(--bad); }
.c-banner svg.i { width: 15px; height: 15px; }
.c-tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.c-tab { height: 28px; padding: 0 11px; border-radius: 8px; border: 0; background: transparent; color: var(--dim); cursor: pointer; font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.c-tab svg.i { width: 14px; height: 14px; }
.c-tab:hover { background: var(--hover); color: var(--ink); }
.c-tab.on { background: var(--accent-soft); color: var(--accent); }
.composer.note .c-tab.on { background: var(--note-bg); color: var(--note-ink); }
.c-hint { margin-left: auto; font-size: 12px; color: var(--faint); display: flex; gap: 5px; align-items: center; }
.c-box {
  display: flex; align-items: flex-end; gap: 4px; border: 1px solid var(--line); border-radius: 13px; padding: 5px;
  background: var(--panel);
}
.c-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer.note .c-box { background: var(--note-bg); border-color: var(--note-line); }
.composer.note .c-box:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--note-line) 45%, transparent); }
.c-box textarea {
  flex: 1; border: 0; outline: none; resize: none; background: transparent; padding: 7px 6px; max-height: 240px;
  min-height: 34px; line-height: 1.45;
}
.c-box .btn.primary { height: 34px; border-radius: 10px; }
.c-attach { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.att {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 6px 5px 10px; border-radius: 9px;
  background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; max-width: 100%;
}
.att img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; }
.att .fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.counter { font-size: 11px; color: var(--faint); align-self: center; padding: 0 4px; }
.counter.bad { color: var(--bad); font-weight: 700; }
.drop {
  position: absolute; inset: 0; z-index: 20; display: none; place-items: center; background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 2px dashed var(--accent); border-radius: 14px; margin: 8px; color: var(--accent); font-weight: 700; font-size: 16px;
}
.thread.dragging .drop { display: grid; }

/* всплывающий список шаблонов */
.pop {
  position: absolute; left: 14px; right: 14px; bottom: calc(100% - 4px); z-index: 30; max-height: 340px; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); overflow: hidden;
}
.pop input { border: 0; border-bottom: 1px solid var(--line); padding: 11px 14px; outline: none; background: transparent; }
.pop .opts { overflow-y: auto; padding: 5px; }
.opt { padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.opt:hover, .opt.on { background: var(--hover); }
.opt.on { outline: 1px solid var(--accent-soft); }
.opt b { display: block; font-weight: 600; font-size: 13.5px; }
.opt span { display: block; color: var(--dim); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer { position: relative; }

/* ---------- карточка клиента */
.card { background: var(--panel); border-left: 1px solid var(--line); overflow-y: auto; min-width: 0; }
.app.no-card .card { display: none; }
.card-top { text-align: center; padding: 26px 18px 18px; border-bottom: 1px solid var(--line); }
.card-top .ava { margin: 0 auto 12px; }
.card-top h3 { margin: 0; font-size: 17px; }
.card-top .sub { color: var(--dim); font-size: 13px; margin-top: 3px; }
.card-sec { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-sec h4 { margin: 0 0 10px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--faint); font-weight: 700; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 10px; font-size: 13px; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.card .input { height: 36px; }
.card .btn { width: 100%; }
.card .stack { display: flex; flex-direction: column; gap: 8px; }

/* ---------- страницы: статистика, шаблоны, команда, журнал */
.page-wrap { overflow-y: auto; min-height: 0; }
.page-in { max-width: 1100px; margin: 0 auto; padding: 28px 28px 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 22px; letter-spacing: -.3px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 26px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.tile .k { font-size: 12.5px; color: var(--dim); font-weight: 500; }
.tile .v { font-size: 28px; font-weight: 750; letter-spacing: -.6px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile .s { font-size: 12px; color: var(--faint); margin-top: 2px; }
.tile.hot .v { color: var(--bad); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel h2 { margin: 0; padding: 14px 16px; font-size: 15px; border-bottom: 1px solid var(--line); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 600; font-size: 12px; color: var(--dim); padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel-2); white-space: nowrap; }
.tbl td { padding: 11px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.off td { color: var(--faint); }
.tpl-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.tpl-list { padding: 6px; max-height: calc(100vh - 170px); overflow-y: auto; }
.tpl-list .opt span { white-space: nowrap; }
.form-pad { padding: 18px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.actions-row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.note-box { background: var(--accent-soft); color: var(--ink); border-radius: 10px; padding: 12px 14px; font-size: 13px; margin-bottom: 16px; }

/* ---------- модальные окна, тосты */
.overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(10,12,16,.45); display: grid; place-items: center; padding: 20px;
  animation: fade .12s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(460px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--panel); border-radius: 16px;
  box-shadow: var(--shadow); border: 1px solid var(--line); animation: pop .14s ease-out;
}
@keyframes pop { from { transform: translateY(6px) scale(.98); opacity: 0; } }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; }
.modal-h h3 { margin: 0; font-size: 16.5px; }
.modal-b { padding: 8px 18px 4px; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px 18px; }
.pick { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; }
.pick button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 0; background: transparent; cursor: pointer; text-align: left; }
.pick button:hover { background: var(--hover); }
.pick button.on { background: var(--accent-soft); }
.lightbox { background: rgba(0,0,0,.85); }
.lightbox img { max-width: 94vw; max-height: 88vh; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lightbox .lb-bar { position: fixed; top: 14px; right: 14px; display: flex; gap: 8px; }
.lightbox .lb-bar .btn { background: rgba(255,255,255,.12); border-color: transparent; color: #fff; }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #15181e; color: #fff; padding: 10px 16px; border-radius: 11px; box-shadow: var(--shadow); font-size: 13.5px;
  max-width: min(520px, 92vw); animation: pop .15s ease-out; pointer-events: auto;
}
.toast.bad { background: #b91c1c; }
.toast.ok { background: #15803d; }

/* ---------- вход */
body.plain, .login-wrap { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.auth-card {
  width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 32px 28px;
  box-shadow: var(--shadow); text-align: center;
}
.auth-card h1 { margin: 12px 0 6px; font-size: 21px; letter-spacing: -.3px; }
.auth-card p { margin: 0 0 20px; }
.auth-card .btn + p { margin: 16px 0 0; }
.brand-mark { width: 56px; height: 56px; border-radius: 16px; background: var(--accent); color: #fff; font-weight: 800; font-size: 26px; display: grid; place-items: center; margin: 0 auto; }
.steps { text-align: left; margin: 0 0 22px; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: baseline; padding: 7px 0; }
.steps li::before { content: counter(s); flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 12px; display: grid; place-items: center; }

/* ---------- телефон */
@media (max-width: 900px) {
  .app, .app.no-card, .app.page { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 58px; }
  .rail { grid-row: 2; flex-direction: row; justify-content: space-around; padding: 0 6px; border-right: 0; border-top: 1px solid var(--line); }
  .rail .logo, .rail .spacer, .rail .conn, .rail .opt-btn { display: none; }
  [data-tip]:hover::after { display: none; }
  .me { margin: 0; }
  .list, .thread, .page-wrap { grid-row: 1; grid-column: 1; }
  .app .thread { display: none; }
  .app.open .thread { display: flex; }
  .app.open .list { display: none; }
  .card { position: fixed; inset: 0 0 58px 0; z-index: 40; display: none; border-left: 0; }
  .app.card-open .card { display: block; }
  .app.no-card .card { display: none; }
  .back { display: inline-grid; }
  .t-head { padding: 8px 10px; gap: 8px; }
  .t-actions .lbl { display: none; }
  .t-body { padding: 12px 10px 8px; }
  .m { max-width: 88%; }
  .c-hint { display: none; }
  .composer .lbl { display: none; }
  .composer .btn.primary { padding: 0 12px; }
  .t-sub { flex-wrap: nowrap; overflow: hidden; }
  .page-in { padding: 18px 14px 40px; }
  .tpl-grid, .two { grid-template-columns: minmax(0, 1fr); }
  .tbl th, .tbl td { padding: 9px 10px; }
  .hide-sm { display: none; }
  .new-below { bottom: 140px; }
}
