/* ============================================================
   IT-Quantum · Статистика диалогов и открытых линий
   Дизайн-система приложения: светлая + тёмная тема,
   настраиваемый акцент / радиус / размер шрифта.
   ============================================================ */

@font-face { font-family: Gotham; src: url(../fonts/gotham_light.woff)  format("woff"); font-weight: 300; font-display: swap; }
@font-face { font-family: Gotham; src: url(../fonts/gotham_book.woff)   format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: Gotham; src: url(../fonts/gotham_medium.woff) format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: Gotham; src: url(../fonts/gotham_bold.woff)   format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: Gotham; src: url(../fonts/gotham_black.woff)  format("woff"); font-weight: 900; font-display: swap; }

/* ─────────────  токены  ───────────── */
:root {
  --accent:      #00A5B0;
  --accent-soft: #00c6d2;
  --accent-ink:  #ffffff;
  --accent-tint: rgba(0, 198, 210, .10);

  --radius: 10px;
  --rs: calc(var(--radius) * .6);
  --fs: 14px;

  --bg:        #eef1f4;
  --panel:     #ffffff;
  --panel-2:   #f7f9fa;
  --panel-3:   #f0f3f5;
  --line:      #e3e7ec;
  --line-soft: #edf0f3;
  --text:      #141414;
  --muted:     #79828d;
  --muted-2:   #9aa3ac;
  --shadow:    0 1px 2px rgba(20, 24, 28, .06), 0 6px 20px rgba(20, 24, 28, .06);
  --shadow-lg: 0 10px 40px rgba(20, 24, 28, .18);
  --danger:    #e5484d;
  --ok:        #17a673;
  --warn:      #e0910b;
  --overlay:   rgba(16, 20, 24, .45);
  --modal:     #ffffff;
}

html[data-theme="dark"] {
  --accent:      #00c6d2;
  --accent-soft: #00e0ee;
  --accent-ink:  #06232a;
  --accent-tint: rgba(0, 198, 210, .12);

  --bg:        #101011;
  --panel:     #17181a;
  --panel-2:   #1d1f21;
  --panel-3:   #232527;
  --line:      rgba(255, 255, 255, .09);
  --line-soft: rgba(255, 255, 255, .05);
  --text:      #f2f3f4;
  --muted:     #949ba3;
  --muted-2:   #6f767e;
  --shadow:    0 1px 2px rgba(0, 0, 0, .5), 0 8px 26px rgba(0, 0, 0, .35);
  --shadow-lg: 0 16px 50px rgba(0, 0, 0, .6);
  --danger:    #ff6369;
  --ok:        #33c98d;
  --warn:      #f0b429;
  --overlay:   rgba(0, 0, 0, .62);
  --modal:     #212325;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { background: var(--bg); }
body {
  font-family: Gotham, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: var(--fs);
  font-weight: 400;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
  padding: 0 0 40px;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }

.hidden { display: none !important; }

/* ─────────────  шапка  ───────────── */
.top {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 26px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 12px 0; }
.brand .mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  display: grid; place-items: center; color: #fff; flex: none;
}
.brand .mark svg { width: 15px; height: 15px; }
.brand b {
  font-weight: 700; font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  white-space: nowrap;
}
.brand span { color: var(--muted); font-size: 12px; white-space: nowrap; }

.tabs { display: flex; gap: 4px; margin-left: 6px; }
.tab {
  padding: 8px 14px; border-radius: var(--rs); color: var(--muted);
  font-weight: 500; font-size: 13px; letter-spacing: .02em; white-space: nowrap;
}
.tab:hover { color: var(--text); background: var(--panel-2); }
.tab.on { color: var(--text); background: var(--accent-tint); }

.top-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: var(--rs); display: grid; place-items: center;
  color: var(--muted); transition: background .14s, color .14s;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn.on { background: var(--accent-tint); color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }

/* ─────────────  каркас  ───────────── */
.wrap { padding: 18px 22px 0; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }

.label {
  display: block; font-size: 11px; font-weight: 500; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px; white-space: nowrap;
}

/* ─────────────  фильтры  ───────────── */
.filters { padding: 16px 18px 18px; }
.frow { display: flex; flex-wrap: wrap; gap: 14px 16px; }
.fcell { flex: 1 1 210px; min-width: 190px; }
.fcell.wide { flex: 2 1 420px; }

.field {
  display: flex; align-items: center; gap: 8px;
  min-height: 38px; padding: 0 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--rs);
  cursor: pointer; transition: border-color .14s, box-shadow .14s;
  position: relative;
}
.field:hover { border-color: var(--muted-2); }
.field.open, .field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.field .ico { color: var(--muted); display: flex; flex: none; }
.field .ico svg { width: 16px; height: 16px; }
.field .val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.field .val.ph { color: var(--muted-2); }
.field .clear { flex: none; color: var(--muted-2); display: none; padding: 2px; border-radius: 4px; }
.field.filled .clear { display: flex; }
.field .clear:hover { color: var(--danger); background: var(--panel-2); }
.field .clear svg { width: 14px; height: 14px; }
.field .caret { flex: none; color: var(--muted-2); }
.field .caret svg { width: 14px; height: 14px; transition: transform .16s; }
.field.open .caret svg { transform: rotate(180deg); }

.actions { display: flex; align-items: flex-end; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

.btn {
  height: 38px; padding: 0 18px; border-radius: var(--rs);
  font-size: 13px; font-weight: 500; letter-spacing: .02em;
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid transparent; transition: all .14s; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-soft); }
.btn-ghost { background: var(--panel); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--muted-2); background: var(--panel-2); }
.btn-soft { background: var(--accent-tint); color: var(--accent); }
.btn-soft:hover { background: var(--accent); color: var(--accent-ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.btn-primary .badge, .btn-soft:hover .badge { background: rgba(255, 255, 255, .28); color: inherit; }

/* ─────────────  выпадашки  ───────────── */
.pop {
  position: absolute; z-index: 60; top: calc(100% + 6px); left: 0;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 8px; min-width: 260px; display: none;
}
.pop.show { display: block; animation: pop .14s ease-out; }
@keyframes pop { from { transform: translateY(-5px); } }

.pop-search {
  width: 100%; height: 34px; padding: 0 10px; margin-bottom: 6px;
  border: 1px solid var(--line); border-radius: var(--rs);
  background: var(--panel-2); font-size: 13px; outline: none;
}
.pop-search:focus { border-color: var(--accent); }

.opt-list { max-height: 260px; overflow: auto; }
.opt {
  display: flex; align-items: center; gap: 9px; padding: 7px 8px;
  border-radius: var(--rs); cursor: pointer; font-size: 13px;
}
.opt:hover { background: var(--panel-2); }
.opt .box {
  width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--line);
  flex: none; display: grid; place-items: center; color: transparent; background: var(--panel);
}
.opt.sel .box { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.opt .box svg { width: 11px; height: 11px; }
.opt .txt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt .dim { color: var(--muted-2); font-size: 11px; }
.pop-foot {
  display: flex; gap: 8px; padding-top: 8px; margin-top: 6px;
  border-top: 1px solid var(--line-soft);
}
.link-btn { font-size: 12px; color: var(--accent); padding: 4px 6px; border-radius: 6px; }
.link-btn:hover { background: var(--accent-tint); }

/* ─────────────  календарь  ───────────── */
.dp { display: flex; gap: 0; padding: 0; }
.dp-presets {
  width: 168px; padding: 10px; border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 2px;
}
.dp-presets button {
  text-align: left; padding: 7px 10px; border-radius: var(--rs);
  font-size: 13px; color: var(--text);
}
.dp-presets button:hover { background: var(--panel-2); }
.dp-presets button.on { background: var(--accent-tint); color: var(--accent); font-weight: 500; }
.dp-cals { display: flex; gap: 22px; padding: 12px 14px; }
.dp-cal { width: 224px; }
.dp-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; height: 26px;
}
.dp-head .m { font-size: 13px; font-weight: 500; text-transform: capitalize; }
.dp-nav { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); }
.dp-nav:hover { background: var(--panel-2); color: var(--text); }
.dp-nav svg { width: 14px; height: 14px; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-dow {
  font-size: 11px; color: var(--muted-2); text-align: center; padding: 4px 0;
  text-transform: lowercase;
}
.dp-day {
  height: 30px; border-radius: 6px; font-size: 13px;
  display: grid; place-items: center; position: relative;
}
.dp-day:hover:not(.off) { background: var(--panel-3); }
.dp-day.off { color: var(--muted-2); opacity: .45; cursor: default; }
.dp-day.wknd { color: var(--danger); }
.dp-day.in { background: var(--accent-tint); border-radius: 0; }
.dp-day.edge { background: var(--accent); color: var(--accent-ink); font-weight: 500; }
.dp-day.edge.a { border-radius: 6px 0 0 6px; }
.dp-day.edge.b { border-radius: 0 6px 6px 0; }
.dp-day.edge.a.b { border-radius: 6px; }
.dp-day.today::after {
  content: ""; position: absolute; bottom: 4px; width: 4px; height: 4px;
  border-radius: 50%; background: var(--accent);
}
.dp-day.edge.today::after { background: var(--accent-ink); }
.dp-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-top: 1px solid var(--line-soft);
}
.dp-manual { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.dp-manual input {
  width: 104px; height: 32px; padding: 0 8px; text-align: center;
  border: 1px solid var(--line); border-radius: var(--rs); background: var(--panel-2); outline: none;
}
.dp-manual input:focus { border-color: var(--accent); }

/* ─────────────  чипы выбранного  ───────────── */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px 4px 10px; border-radius: 20px;
  background: var(--panel-2); border: 1px solid var(--line);
  font-size: 12px; color: var(--text);
}
.chip button { color: var(--muted-2); display: flex; }
.chip button:hover { color: var(--danger); }
.chip svg { width: 12px; height: 12px; }

/* ─────────────  строка состояния  ───────────── */
.statusbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 18px; margin-top: 14px;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--panel); box-shadow: var(--shadow);
}
.queue { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); }
.queue b { color: var(--text); font-size: 15px; font-weight: 700; }
.queue .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.queue.warn .dot { background: var(--warn); box-shadow: 0 0 0 4px rgba(224, 145, 11, .16); }
.sb-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.legend-btn {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted);
  padding: 5px 9px; border-radius: var(--rs); border: 1px dashed var(--line);
}
.legend-btn:hover { color: var(--accent); border-color: var(--accent); }
.legend-btn svg { width: 14px; height: 14px; }

/* ─────────────  сводка  ───────────── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; margin-top: 14px; }
.kpi {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px; position: relative; overflow: hidden;
}
.kpi::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--accent-soft), var(--accent));
}
.kpi .k {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kpi .v { font-size: 24px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--muted-2); margin-top: 3px; }
.kpi.alert .v { color: var(--danger); }
.kpi.alert::before { background: linear-gradient(180deg, var(--danger), var(--danger)); }

/* ─────────────  таблица  ───────────── */
.table-card { margin-top: 14px; overflow: hidden; }
.tw { overflow: auto; max-height: calc(100vh - 300px); min-height: 220px; }
table.grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
table.grid th, table.grid td {
  padding: 9px 12px; text-align: right; white-space: nowrap;
  border-bottom: 1px solid var(--line-soft);
}
table.grid thead th {
  position: sticky; background: var(--panel-2); z-index: 3;
  font-weight: 500; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--line); vertical-align: bottom;
  white-space: normal; line-height: 1.25;
}
table.grid thead tr:first-child th { top: 0; height: 34px; text-align: center; }
table.grid thead tr:nth-child(2) th { top: 34px; }
table.grid thead th.grp {
  text-align: center; border-left: 1px solid var(--line);
  color: var(--text); letter-spacing: .1em;
}
table.grid th.sortable { cursor: pointer; user-select: none; }
table.grid th.sortable:hover { color: var(--accent); }
table.grid th .arw { opacity: 0; margin-left: 4px; font-size: 10px; }
table.grid th.sorted .arw { opacity: 1; color: var(--accent); }
table.grid th.bl, table.grid td.bl { border-left: 1px solid var(--line); }

table.grid th.c1, table.grid td.c1 {
  position: sticky; left: 0; z-index: 2; text-align: left;
  background: var(--panel); min-width: 210px; max-width: 260px;
  border-right: 1px solid var(--line);
}
table.grid thead th.c1 { z-index: 5; background: var(--panel-2); }
table.grid tbody tr:hover td { background: var(--panel-2); }
table.grid tbody tr:hover td.c1 { background: var(--panel-3); }
table.grid tr.total td { font-weight: 700; background: var(--panel-2); border-bottom: 1px solid var(--line); }
table.grid tr.total td.c1 { background: var(--panel-2); }

.who { display: flex; align-items: center; gap: 9px; overflow: hidden; }
.ava {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 700;
  background-size: cover; background-position: center; letter-spacing: .02em;
}
.who .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .fired { font-size: 10px; color: var(--muted-2); border: 1px solid var(--line); padding: 0 4px; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; }
.num.z { color: var(--muted-2); }
.drill { color: var(--accent); border-bottom: 1px dashed transparent; }
.drill:hover { border-bottom-color: var(--accent); }
.late { color: var(--danger); font-weight: 500; }

.empty { padding: 54px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: var(--muted-2); margin-bottom: 12px; }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 5px; font-weight: 500; }

.table-foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; border-top: 1px solid var(--line);
  background: var(--panel-2);
}
.table-foot .hint { font-size: 12px; color: var(--muted); margin-left: auto; }

/* ─────────────  прогресс  ───────────── */
.progress { padding: 26px 20px; }
.progress .pt { font-size: 13px; color: var(--muted); margin-bottom: 10px; display: flex; gap: 8px; }
.progress .pt b { color: var(--text); font-weight: 500; }
.bar { height: 6px; border-radius: 4px; background: var(--panel-3); overflow: hidden; }
.bar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  border-radius: 4px; transition: width .25s;
}
.steps { display: flex; gap: 18px; margin-top: 14px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted-2); }
.step .n {
  width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line);
  display: grid; place-items: center; font-size: 10px; flex: none;
}
.step.on { color: var(--text); }
.step.on .n { border-color: var(--accent); color: var(--accent); }
.step.done { color: var(--muted); }
.step.done .n { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.step.done .n svg { width: 10px; height: 10px; }

/* ─────────────  модалки  ───────────── */
.modal-bg {
  position: fixed; inset: 0; background: var(--overlay); z-index: 100;
  display: none; align-items: flex-start; justify-content: center;
  padding: 40px 20px; overflow: auto;
}
.modal-bg.show { display: flex; }
.modal {
  background: var(--modal); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 940px; animation: pop .16s ease-out;
}
.modal.sm { max-width: 560px; }
.modal-h {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.modal-h h3 { font-size: 15px; font-weight: 500; letter-spacing: .02em; }
.modal-h .sub { font-size: 12px; color: var(--muted); }
.modal-h .x { margin-left: auto; }
.modal-b { padding: 18px 20px; }
.modal-b .tw { max-height: 56vh; }
.modal-f {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--line); background: var(--panel-2);
  border-radius: 0 0 var(--radius) var(--radius);
}
.modal-f .right { margin-left: auto; display: flex; gap: 10px; }

.ta {
  width: 100%; min-height: 92px; padding: 10px 12px; resize: vertical;
  border: 1px solid var(--line); border-radius: var(--rs);
  background: var(--panel-2); font-size: 13px; outline: none; line-height: 1.5;
  font-family: inherit;
}
.ta:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.fgroup + .fgroup { margin-top: 16px; }
.fgroup .hint { font-size: 12px; color: var(--muted-2); margin-top: 5px; }

/* ─────────────  настройки  ───────────── */
.settings { padding: 4px 0 0; }
.sect { padding: 18px 20px; border-bottom: 1px solid var(--line-soft); }
.sect:last-child { border-bottom: 0; }
.sect h4 {
  font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px;
}
.row {
  display: flex; align-items: center; gap: 14px; padding: 9px 0;
  border-bottom: 1px dashed var(--line-soft);
}
.row:last-child { border-bottom: 0; }
.row .t { font-size: 13px; }
.row .d { font-size: 12px; color: var(--muted-2); margin-top: 2px; }
.row .ctl { margin-left: auto; flex: none; }

.sw { width: 40px; height: 22px; border-radius: 12px; background: var(--line); position: relative; transition: background .16s; flex: none; }
.sw::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: transform .16s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.sw.on { background: var(--accent); }
.sw.on::after { transform: translateX(18px); }

.inp {
  height: 36px; padding: 0 10px; width: 120px;
  border: 1px solid var(--line); border-radius: var(--rs);
  background: var(--panel-2); outline: none; font-size: 13px;
}
.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
select.inp { width: 160px; cursor: pointer; }

.days { display: flex; gap: 6px; flex-wrap: wrap; }
.day {
  width: 40px; height: 32px; border-radius: var(--rs); border: 1px solid var(--line);
  font-size: 12px; font-weight: 500; color: var(--muted); background: var(--panel);
  text-transform: uppercase;
}
.day:hover { border-color: var(--muted-2); color: var(--text); }
.day.on { background: var(--accent-tint); border-color: var(--accent); color: var(--accent); }

.rng { display: flex; align-items: center; gap: 12px; }
.rng input[type=range] { width: 150px; accent-color: var(--accent); }
.rng .v {
  min-width: 44px; height: 28px; padding: 0 8px; border-radius: var(--rs);
  background: var(--accent-tint); color: var(--accent); font-size: 12px; font-weight: 500;
  display: grid; place-items: center;
}

/* ─────────────  панель оформления  ───────────── */
.skin {
  position: absolute; right: 14px; top: 56px; z-index: 70;
  width: 320px; padding: 16px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); display: none;
}
.skin.show { display: block; animation: pop .14s ease-out; }
.skin h4 { font-size: 14px; font-weight: 500; margin-bottom: 2px; }
.skin .sub { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.skin .grp + .grp { margin-top: 14px; }
.skin .gt {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.sw-b {
  display: flex; align-items: center; gap: 7px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: var(--rs); font-size: 12px;
}
.sw-b i { width: 13px; height: 13px; border-radius: 50%; flex: none; }
.sw-b:hover { border-color: var(--muted-2); }
.sw-b.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button {
  min-width: 44px; height: 30px; padding: 0 10px; border-radius: var(--rs);
  border: 1px solid var(--line); font-size: 12px; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.seg button:hover { color: var(--text); border-color: var(--muted-2); }
.seg button.on { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); }
.seg button svg { width: 14px; height: 14px; }

/* ─────────────  тосты  ───────────── */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: var(--rs);
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: var(--shadow-lg); font-size: 13px; max-width: 380px;
  animation: pop .16s ease-out;
}
.toast svg { width: 16px; height: 16px; flex: none; }
.toast.err { border-color: var(--danger); color: var(--danger); }
.toast.ok svg { color: var(--ok); }

/* ─────────────  легенда  ───────────── */
.leg-item { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line-soft); }
.leg-item:last-child { border-bottom: 0; }
.leg-item b { flex: none; width: 210px; font-weight: 500; font-size: 13px; }
.leg-item span { font-size: 13px; color: var(--muted); }

/* ─────────────  адаптив  ───────────── */
@media (max-width: 900px) {
  .wrap { padding: 14px 12px 0; }
  .top { padding: 0 12px; gap: 12px; }
  .brand span { display: none; }
  .dp { flex-direction: column; }
  .dp-presets { width: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .dp-cals { flex-direction: column; }
  .skin { right: 8px; left: 8px; width: auto; }
}
