@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('/fonts/InterVariable.woff2') format('woff2');
}
:root {
  --bg: #0a0e16; --bg-soft: #10151f; --panel: #141b28; --panel-2: #1a2331;
  --border: #2a3547; --border-soft: #202b3b; --text: #eef3fb; --muted: #a3b2c9;
  --primary: #6366f1; --primary-2: #818cf8; --green: #22c55e; --red: #ef4444;
  --amber: #f59e0b; --cyan: #06b6d4; --pink: #ec4899; --violet: #8b5cf6;
  --radius: 14px; --shadow: 0 12px 34px rgba(0,0,0,.42);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: 'Inter', -apple-system, "Segoe UI", Roboto, system-ui, sans-serif; font-size: 14.5px; font-weight: 440; line-height: 1.45; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; letter-spacing: -.14px; font-feature-settings: 'cv05', 'cv11', 'ss03'; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
a { color: inherit; text-decoration: none; cursor: pointer; }
input, select, button, textarea { font-family: inherit; font-size: 14px; color: var(--text); }
.ic { flex-shrink: 0; vertical-align: -.15em; }
.num { font-variant-numeric: tabular-nums; }

/* login */
.login-screen { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(700px 460px at 50% -5%, rgba(99,102,241,.18) 0%, var(--bg) 62%); z-index: 50; }
.login-card { width: 380px; max-width: 90vw; background: linear-gradient(180deg, var(--panel), var(--bg-soft)); border: 1px solid var(--border); border-radius: 22px; padding: 38px 32px; box-shadow: var(--shadow); text-align: center; display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { font-size: 24px; }
.login-card input { background: var(--bg-soft); border: 1px solid var(--border); color: var(--text); padding: 12px 14px; border-radius: 11px; outline: none; }
.login-card input:focus { border-color: var(--primary); }
.login-error { color: var(--red); font-size: 13px; min-height: 16px; }

/* layout */
/* Сайдбар шире: у пунктов теперь счётчики (тикеты/абуз/шеринг/лимит) — названию и кружку нужен воздух */
.app { display: grid; grid-template-columns: 268px 1fr; height: 100vh; }
.sidebar { background: linear-gradient(180deg, rgba(16,21,31,.9), var(--bg)); border-right: 1px solid var(--border); padding: 20px 14px; display: flex; flex-direction: column; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; padding: 2px 8px 18px; }
.brand-mark { display: inline-flex; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; font-size: 14px; cursor: pointer; transition: all .13s; }
.nav-item .ic { width: 18px; height: 18px; }
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: linear-gradient(90deg, rgba(99,102,241,.24), rgba(99,102,241,.05)); color: #fff; box-shadow: inset 2px 0 0 var(--primary); }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--primary-2), var(--primary)); display: grid; place-items: center; font-weight: 700; color: #fff; }

.main { overflow-y: auto; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; padding: 14px 24px; background: rgba(10,14,22,.8); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.topbar h2 { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.filterbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.view { padding: 22px 24px; }

/* controls */
.chip-btn { background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); padding: 7px 12px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 12.5px; transition: all .13s; }
.chip-btn:hover { color: var(--text); border-color: var(--primary); }
.chip-btn.active { background: linear-gradient(180deg, var(--primary-2), var(--primary)); color: #fff; border-color: transparent; }
.seg { display: inline-flex; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.seg button { background: transparent; border: none; color: var(--muted); padding: 6px 11px; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 12.5px; }
.seg button.active { background: var(--primary); color: #fff; }
select, .input { background: var(--bg-soft); border: 1px solid var(--border); color: var(--text); padding: 8px 11px; border-radius: 9px; outline: none; cursor: pointer; font-size: 13px; }
select:focus, .input:focus { border-color: var(--primary); }
.daterange { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 9px; padding: 4px 9px; }
.daterange input { background: transparent; border: none; outline: none; color: var(--text); font-size: 12.5px; }
.btn { border: 1px solid var(--border); background: var(--panel-2); color: var(--text); padding: 8px 13px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 7px; transition: all .13s; }
.btn:hover { border-color: var(--primary); }
.btn-primary { background: linear-gradient(180deg, var(--primary-2), var(--primary)); border-color: transparent; color: #fff; }
.btn.ghost { background: transparent; }
.spacer { flex: 1; }

/* kpi grid */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 13px; margin-bottom: 20px; }
.kpi { background: linear-gradient(180deg, var(--panel), var(--bg-soft)); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 16px; cursor: pointer; transition: transform .13s, border-color .13s; }
.kpi:hover { transform: translateY(-2px); border-color: var(--primary); }
.kpi-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.kpi-badge { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--accent, var(--primary)); background: color-mix(in srgb, var(--accent, var(--primary)) 16%, transparent); }
.kpi-label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi-value { font-size: 23px; font-weight: 750; letter-spacing: -.5px; }
.kpi-sub { font-size: 11.5px; margin-top: 5px; display: flex; align-items: center; gap: 4px; }
.up { color: var(--green); } .down { color: var(--red); }

/* panels & charts */
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: 1fr 1fr 1fr; }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 22px; cursor: pointer; padding: 0 2px; line-height: 1; }
.clk { cursor: pointer; }
.clk:hover .kpi { border-color: var(--accent); }
.legend-item.clk:hover { color: var(--primary); }
.nav-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 150; }
.nav-backdrop.hidden { display: none; }
@media (min-width: 1700px) { .kpi-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); } }
@media (max-width: 1000px) {
  .g2, .g3, .g-2-1 { grid-template-columns: 1fr; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; transform: translateX(-100%); transition: transform .25s ease; z-index: 200; }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.65); }
  .nav-toggle { display: inline-flex; align-items: center; }
  .topbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; }
  .topbar h2 { margin: 0; }
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .kpi-value { font-size: 19px; } .kpi.hero .hero-val { font-size: 23px; }
  .panel { padding: 12px 13px; } .modal { padding: 15px; border-radius: 14px; }
  .fn-stage { grid-template-columns: 88px 1fr; } .fn-meta { display: none; }
  .section-title { font-size: 11px; }
}
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.panel-head h3 { font-size: 14.5px; }
.panel-head .tools { display: flex; align-items: center; gap: 6px; }
.chart-box { position: relative; height: 300px; }
.chart-box.sm { height: 240px; }
.chip-soft { font-size: 12px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--border); padding: 3px 9px; border-radius: 999px; }
.legend { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; max-height: 240px; overflow-y: auto; }
.legend-item { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.legend-item .l { display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* tables */
.table-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding: 11px 13px; border-bottom: 1px solid var(--border); font-weight: 600; white-space: nowrap; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
td { padding: 11px 13px; border-bottom: 1px solid var(--border-soft); font-size: 13px; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--panel-2); }
tbody tr.clickable { cursor: pointer; }
.sort-idle { opacity: .3; font-size: 10px; }
.table-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.pager { display: flex; align-items: center; gap: 6px; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.b-green { color: var(--green); background: rgba(34,197,94,.13); }
.b-red { color: var(--red); background: rgba(239,68,68,.13); }
.b-amber { color: var(--amber); background: rgba(245,158,11,.13); }
.b-cyan { color: var(--cyan); background: rgba(6,182,212,.13); }
.b-violet { color: var(--violet); background: rgba(139,92,246,.13); }
.b-gray { color: var(--muted); background: var(--panel-2); }

/* misc */
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 12px; font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: sp .7s linear infinite; vertical-align: -2px; }
@keyframes sp { to { transform: rotate(360deg); } }
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.toast { display: flex; align-items: center; gap: 9px; background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--primary); padding: 11px 15px; border-radius: 11px; box-shadow: var(--shadow); font-size: 13px; max-width: 340px; }
.toast.err { border-left-color: var(--red); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(4,7,12,.62); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 40; }
.modal { width: 900px; max-width: 94vw; max-height: 88vh; overflow: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); }
.modal h3 { margin-bottom: 14px; }
.hint { background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: 11px; padding: 11px 14px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
/* v2 components */
.presets { display: flex; gap: 5px; flex-wrap: wrap; }
.kpi.drill { cursor: pointer; }
.kpi.drill:hover { border-color: var(--primary); }
.anom-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.anom { display: flex; gap: 9px; align-items: center; background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--cyan); border-radius: 11px; padding: 10px 13px; font-size: 13px; flex: 1; min-width: 230px; }
.anom.critical { border-left-color: var(--red); } .anom.critical .ic { color: var(--red); }
.anom.warning { border-left-color: var(--amber); } .anom.warning .ic { color: var(--amber); }
.anom.info { border-left-color: var(--cyan); } .anom.info .ic { color: var(--cyan); }
.anom-wrap { margin-bottom: 18px; } .anom-wrap .anom-row { margin-bottom: 8px; }
/* Телефон: аномалии компактнее — меньше отступы/шрифт, каждая в свою строку без распухания */
@media (max-width: 640px) {
  .anom-row { gap: 6px; margin-bottom: 8px; }
  .anom { padding: 6px 9px; font-size: 12px; min-width: 100%; border-radius: 8px; }
  .anom .muted { font-size: 10px !important; }
  .notif-row { flex-wrap: wrap; font-size: 12px; }
}
.link { color: var(--primary-2); cursor: pointer; } .link:hover { text-decoration: underline; }
.notif-row { display: flex; gap: 12px; align-items: center; padding: 11px 2px; border-bottom: 1px solid var(--border-soft); }
.notif-row:last-child { border-bottom: none; }
.notif-row.read { opacity: .45; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.chk input { accent-color: var(--primary); }
.cols-dd { position: relative; }
.cols-dd summary { list-style: none; cursor: pointer; }
.cols-dd summary::-webkit-details-marker { display: none; }
.cols-pop { position: absolute; right: 0; top: 110%; z-index: 30; background: var(--panel, #141b28); border: 1px solid var(--border-soft); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; box-shadow: 0 8px 28px rgba(0,0,0,.4); min-width: 180px; }
.qblock { margin-bottom: 16px; }
.q-title { font-size: 14px; font-weight: 600; color: var(--text); margin: 4px 2px 8px; opacity: .92; }
.kpi.hero { grid-column: span 2; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--panel)), var(--panel)); border-color: color-mix(in srgb, var(--accent) 35%, var(--border-soft)); }
.kpi.hero .hero-val { font-size: 30px; }
.kpi-q { font-size: 10px; letter-spacing: .5px; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 2px; }
@media (max-width: 720px) { .kpi.hero { grid-column: span 1; } }
.fn { display: flex; flex-direction: column; gap: 8px; }
.fn-stage { display: grid; grid-template-columns: 180px 1fr 150px; gap: 10px; align-items: center; }
.fn-lbl { font-size: 13px; color: var(--text); }
.fn-bar-wrap { background: var(--panel-2, rgba(255,255,255,.04)); border-radius: 6px; overflow: hidden; }
.fn-bar { background: linear-gradient(90deg, var(--primary), #818cf8); min-width: 34px; height: 30px; display: flex; align-items: center; justify-content: flex-end; padding-right: 10px; border-radius: 6px; transition: width .4s; }
.fn-bar span { color: #fff; font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums; }
.fn-meta { font-size: 12px; text-align: right; }
.fn-timeline { display: flex; flex-direction: column; gap: 2px; }
.fn-step { display: flex; align-items: center; gap: 8px; padding: 8px 4px; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.fn-step:last-child { border-bottom: none; }
.fn-step.done { color: var(--text); }
.fn-step.miss { opacity: .45; }
.fn-step.done svg { color: var(--green); }
.fn-step.miss svg { color: var(--muted); }
@media (max-width: 720px) { .fn-stage { grid-template-columns: 110px 1fr; } .fn-meta { display: none; } }
.info-dot { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--muted); color: var(--muted); font-size: 9px; font-weight: 700; cursor: help; vertical-align: middle; line-height: 1; user-select: none; }
.info-dot:hover, .info-dot:focus { border-color: var(--primary); color: var(--primary); outline: none; }
.info-pop { position: fixed; z-index: 9999; width: 300px; max-width: calc(100vw - 24px); background: #0c1220; border: 1px solid var(--primary); border-radius: 10px; padding: 12px 14px; box-shadow: 0 12px 40px rgba(0,0,0,.55); font-size: 12px; line-height: 1.5; pointer-events: none; }
/* Автоподсказки пользователей (typeahead) */
.ta-pop { position: fixed; z-index: 9999; background: var(--panel, #141b28); border: 1px solid var(--primary); border-radius: 9px; box-shadow: 0 14px 44px rgba(0,0,0,.55); max-height: 340px; overflow-y: auto; padding: 4px; }
.ta-item { padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.ta-item.sel, .ta-item:hover { background: rgba(129,140,248,.16); }
.ta-main { font-size: 13px; font-weight: 500; }
.ta-sub { font-size: 11px; margin-top: 1px; }
.ta-tag { font-size: 10px; padding: 1px 6px; border-radius: 6px; background: var(--panel-2); color: var(--muted); vertical-align: middle; }
.info-pop .ip-t { font-weight: 700; font-size: 13px; margin-bottom: 6px; color: var(--text); }
.info-pop .ip-c { color: var(--text); margin-bottom: 5px; }
.info-pop .ip-m { color: var(--muted); }
.info-pop b { color: var(--primary); font-weight: 600; }
.star-btn { background: none; border: none; cursor: pointer; font-size: 20px; line-height: 1; color: var(--muted); padding: 0; transition: color .15s, transform .1s; }
.star-btn:hover { transform: scale(1.15); }
.star-btn.on { color: #f5c518; text-shadow: 0 0 8px rgba(245,197,24,.5); }
.note-box { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 14px; }
.scroll-card { max-height: 340px; overflow-y: auto; }
.scroll-card .table-wrap { overflow: visible; }
.heat-cell { cursor: pointer; transition: transform .08s, box-shadow .08s; }
.heat-cell:hover { transform: scale(1.35); box-shadow: 0 0 0 2px var(--primary); border-radius: 3px; position: relative; z-index: 2; }
.htip { position: fixed; z-index: 9999; background: #0c1220; border: 1px solid var(--primary); border-radius: 9px; padding: 8px 11px; font-size: 12px; line-height: 1.55; pointer-events: none; box-shadow: 0 10px 30px rgba(0,0,0,.5); white-space: nowrap; }
.htip .ht-h { font-weight: 700; color: var(--text); margin-bottom: 2px; }
.kpi { position: relative; }
.kpi-go { position: absolute; top: 8px; right: 9px; font-size: 13px; line-height: 1; color: var(--muted); opacity: .5; transition: opacity .15s, transform .15s, color .15s; }
.kpi.drill:hover .kpi-go { opacity: 1; color: var(--accent); transform: translate(2px, -2px); }
.copy-hwid { cursor: pointer; font-family: ui-monospace, monospace; font-size: 11px; color: var(--muted); border-bottom: 1px dashed var(--muted); transition: color .12s, border-color .12s; }
.copy-hwid:hover { color: var(--primary); border-color: var(--primary); }
.copy-hwid::after { content: ' ⧉'; font-size: 10px; opacity: .7; }
.flag { display: inline-block; width: 21px; height: 14px; border-radius: 2px; overflow: hidden; vertical-align: middle; box-shadow: 0 0 0 1px rgba(255,255,255,.14); margin-right: 4px; }
.flag svg { width: 100%; height: 100%; display: block; }
.flag.flag-txt { width: auto; height: auto; padding: 1px 5px; background: var(--panel-2); font-size: 10px; font-weight: 600; box-shadow: none; color: var(--muted); border-radius: 3px; }
/* P&L */
.pnl-row { display: flex; justify-content: space-between; padding: 8px 2px; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; }
.pnl-row.mid { font-weight: 600; color: var(--cyan); }
.pnl-row.tot { font-weight: 750; font-size: 15px; border-top: 1px solid var(--border); border-bottom: none; margin-top: 4px; color: var(--green); }
/* heatmap */
.heat { display: flex; flex-direction: column; gap: 3px; overflow-x: auto; }
.heat-hours { display: grid; grid-template-columns: 34px repeat(8, 1fr); font-size: 10px; color: var(--muted); }
.heat-row { display: grid; grid-template-columns: 34px repeat(24, 1fr); gap: 2px; align-items: center; }
.heat-day { font-size: 11px; color: var(--muted); }
.heat-cell { aspect-ratio: 1; border-radius: 3px; min-height: 14px; }

/* tags */
.tagbox-wrap { position: relative; }
.tagbox { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 7px 9px; min-height: 40px; cursor: text; }
.tagbox:focus-within { border-color: var(--primary); }
.tag-in { background: transparent; border: none; outline: none; color: var(--text); flex: 1; min-width: 110px; font-size: 13px; }
.tagchip { display: inline-flex; align-items: center; gap: 5px; background: rgba(99,102,241,.16); color: var(--primary-2); padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.tagchip.sm { font-size: 11px; padding: 1px 7px; }
.tagchip .x { cursor: pointer; opacity: .8; }
.tagchip .x:hover { opacity: 1; }
.tag-dd { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 5px; max-height: 200px; overflow-y: auto; }
.tag-dd div { padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.tag-dd div:hover { background: var(--panel-2); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #313d52; }

/* ---- Абуз: Гант-хронология подписок ---- */
.ab-gt { display: flex; flex-direction: column; gap: 6px; padding: 8px 0 2px; }
.ab-gt-row { display: flex; align-items: center; gap: 10px; }
.ab-gt-lbl { width: 148px; flex: 0 0 148px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-gt-track { position: relative; flex: 1; height: 20px; background: var(--panel-2); border-radius: 5px; overflow: hidden; }
.ab-gt-bar { position: absolute; top: 4px; height: 12px; border-radius: 3px; min-width: 3px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.ab-gt-dev { position: absolute; top: 0; width: 2px; height: 20px; background: #fff; opacity: .9; }
.ab-gt-now { position: absolute; top: 0; height: 20px; border-left: 1px dashed var(--amber); }
.ab-gt-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin-top: 10px; align-items: center; }
.ab-gt-legend i { display: inline-block; width: 12px; height: 8px; border-radius: 2px; vertical-align: middle; margin-right: 4px; }
.ab-gt-legend .ab-gt-devi { width: 2px; height: 12px; background: #fff; border-radius: 0; }
.ab-gt-legend .ab-gt-nowi { width: 0; height: 12px; border-left: 1px dashed var(--amber); border-radius: 0; }
.ab-gt-legend .ab-gt-bani { width: 15px; height: 9px; border-radius: 2px; background: var(--red); background-image: repeating-linear-gradient(45deg, rgba(0,0,0,.42) 0 2px, transparent 2px 4px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.6); }
.ab-devhops { font-size: 12px; line-height: 1.7; margin-top: 8px; padding: 8px 10px; background: var(--panel-2); border-radius: 8px; }
/* сетка/ось хронологии + метка приостановки */
.ab-gt-track { background-image: repeating-linear-gradient(to right, transparent 0, transparent calc(25% - 1px), var(--border-soft) calc(25% - 1px), var(--border-soft) 25%); }
.ab-gt-axisrow { margin-bottom: 2px; }
.ab-gt-axis { position: relative; flex: 1; height: 13px; }
.ab-gt-axis span { position: absolute; top: 0; font-size: 10px; color: var(--muted); white-space: nowrap; }
.ab-gt-susp { position: absolute; top: 0; width: 3px; height: 20px; background: var(--red); box-shadow: 0 0 0 1px rgba(0,0,0,.3); }
.ab-gt-unban { position: absolute; top: 0; width: 3px; height: 20px; background: var(--green); box-shadow: 0 0 0 1px rgba(0,0,0,.3); }
.ab-gt-legend .ab-gt-suspi2 { width: 3px; height: 12px; background: var(--red); border-radius: 0; }
/* Hover-подсветка хронологии: наведённая строка ярче, остальные тускнеют, период проецируется на все строки */
.ab-gt { position: relative; }
.ab-gt-proj { position: absolute; top: 2px; bottom: 2px; background: rgba(129,140,248,.12); border-left: 1.5px dashed rgba(129,140,248,.85); border-right: 1.5px dashed rgba(129,140,248,.85); border-radius: 3px; pointer-events: none; display: none; z-index: 3; }
.ab-gt.dimming .ab-gt-proj { display: block; }
.ab-gt.dimming .ab-gt-row:not(.ab-gt-axisrow):not(.hl) { opacity: .22; filter: saturate(.3); }
.ab-gt-row.hl { position: relative; z-index: 4; }
.ab-gt-row.hl .ab-gt-bar { top: 2px; height: 16px; filter: brightness(1.28) saturate(1.4); }
.ab-gt-bar { transition: top .1s, height .1s, filter .1s; }
.ab-gt-row { transition: opacity .1s, filter .1s; }
/* Связка наведения хронология ↔ таблица «Аккаунты на этом устройстве» */
.ab-acctable tbody tr { transition: opacity .1s, background .1s; }
.ab-acctable.ab-dim tbody tr:not(.ab-hl) { opacity: .26; }
.ab-acctable tbody tr.ab-hl { background: rgba(129,140,248,.16); }
/* хронология: даты/длительность/разрыв в днях на каждой строке + метка длительности на баре */
.ab-gt-lbl { width: 190px; flex: 0 0 190px; overflow: visible; white-space: normal; line-height: 1.2; }
.ab-gt-lbl > a { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: 12px; }
.ab-gt-sub { font-size: 10px; color: var(--muted); white-space: nowrap; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; }
.ab-gt-durlbl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: rgba(255,255,255,.92); pointer-events: none; text-shadow: 0 1px 2px rgba(0,0,0,.45); }

/* Рейтинг подозрительности: колонка «Аккаунты» = общее число + разбивка по состоянию (ПЛАТИТ/FREE/ИСТЁК/ОТКЛ). */
/* Отметки просмотра в рейтинге: где уже был (приглушённая метка) и что открывал последним (акцент). */
#ab-body tr.ab-seen > td:first-child, #ab-body tr.ab-last > td:first-child { position: relative; }
#ab-body tr.ab-seen > td:first-child::before {
  content: ''; position: absolute; left: -2px; top: 7px; bottom: 7px; width: 3px; border-radius: 3px; background: var(--muted); opacity: .45;
}
#ab-body tr.ab-seen > td { opacity: .62; }                       /* просмотренное гаснет — глаз цепляется за непросмотренное */
#ab-body tr.ab-seen:hover > td { opacity: 1; }
#ab-body tr.ab-last > td { opacity: 1; }
#ab-body tr.ab-last { background: color-mix(in srgb, var(--primary) 13%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 42%, transparent); }
#ab-body tr.ab-last > td:first-child::before { background: var(--primary-2); opacity: 1; box-shadow: 0 0 10px var(--primary); }
.ab-seen-chip b { color: var(--primary-2); cursor: pointer; font-weight: 700; margin-left: 4px; }
.ab-seen-chip b:hover { text-decoration: underline; }

.ab-acc { white-space: nowrap; }
.ab-acc-n { font-size: 15px; font-weight: 700; margin-right: 8px; vertical-align: 2px; }
.ab-mix { display: inline-flex; gap: 4px; flex-wrap: wrap; vertical-align: middle; }
.ab-mix .badge { padding: 1px 7px; font-size: 10.5px; font-weight: 700; letter-spacing: .2px; }
.ab-gt-legend .ab-gt-unbani { width: 3px; height: 12px; background: var(--green); border-radius: 0; }
.ig-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ab-io-tabs button { font-size: 12px; padding: 5px 10px; }
.ab-ses-accs { display: flex; flex-direction: column; gap: 5px; }
.ab-ses-acc { font-size: 12px; padding: 6px 9px; background: var(--panel-2); border-radius: 7px; line-height: 1.5; }
.pm-item textarea, .pm-add textarea { overflow: hidden; min-height: 40px; }

/* ---- Плавающие окна (draggable/resizable) ---- */
#floats { position: fixed; inset: 0; pointer-events: none; z-index: 200; }
.fwin { position: absolute; pointer-events: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; min-width: 340px; min-height: 180px; }
.fwin-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 8px 12px; background: var(--panel-2); border-bottom: 1px solid var(--border); cursor: move; user-select: none; flex: 0 0 auto; }
.fwin-title { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fwin-title svg { flex: 0 0 auto; }
.fwin-actions { display: flex; gap: 4px; flex: 0 0 auto; }
.fwin-btn { width: 28px; height: 24px; border-radius: 6px; border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; line-height: 1; }
.fwin-btn:hover { background: var(--panel); color: var(--text); }
.fwin-close:hover { border-color: var(--red); color: var(--red); }
.fwin-body { flex: 1 1 auto; overflow: auto; padding: 14px; }
.fwin-collapsed { height: auto !important; min-height: 0; }
.fwin-collapsed .fwin-body, .fwin-collapsed .fwin-grip, .fwin-collapsed .fwin-rz { display: none; }
.fwin-grip { position: absolute; right: 1px; bottom: 1px; width: 18px; height: 18px; cursor: nwse-resize; z-index: 6; background: linear-gradient(135deg, transparent 0 45%, var(--border) 45% 55%, transparent 55% 65%, var(--border) 65% 75%, transparent 75%); }
/* Ресайз за любой край: тонкие полосы по краям (внутри, т.к. .fwin overflow:hidden) + низ-левый угол */
.fwin-rz { position: absolute; z-index: 6; }
.fwin-rz[data-rz="n"] { top: 0; left: 12px; right: 12px; height: 6px; cursor: ns-resize; }
.fwin-rz[data-rz="s"] { bottom: 0; left: 12px; right: 12px; height: 6px; cursor: ns-resize; }
.fwin-rz[data-rz="e"] { top: 12px; bottom: 12px; right: 0; width: 6px; cursor: ew-resize; }
.fwin-rz[data-rz="w"] { top: 12px; bottom: 12px; left: 0; width: 6px; cursor: ew-resize; }
.fwin-rz[data-rz="sw"] { bottom: 0; left: 0; width: 14px; height: 14px; cursor: nesw-resize; }
@media (max-width: 760px) {
  .fwin { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; height: 100dvh !important; border-radius: 0; border: 0; }
  .fwin-head { cursor: default; }
  .fwin-grip { display: none; }
  .fwin-body { padding: 12px; }
}
/* HWID в таблицах: имя — ссылка на хронологию устройства, рядом отдельная кнопка копирования */
.hwid-cell { display: inline-flex; align-items: center; gap: 6px; }
.hwid-link { cursor: pointer; border-bottom: 1px dashed color-mix(in srgb, var(--primary) 55%, transparent); font-family: ui-monospace, monospace; font-size: 12px; }
.hwid-link:hover { color: var(--primary); border-bottom-color: var(--primary); }
.hwid-copy { background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 2px; display: inline-flex; opacity: .6; }
.hwid-copy:hover { color: var(--primary); opacity: 1; }
/* Хронология устройства: вертикальный таймлайн «добавлено / снято» */
.hh-line { position: relative; padding-left: 18px; }
.hh-line::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--border); border-radius: 2px; }
.hh-ev { position: relative; padding: 7px 0; font-size: 13px; }
.hh-ev .hh-dot { position: absolute; left: -17px; top: 12px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--bg); }
.hh-ev.add .hh-dot { background: var(--green); }
.hh-ev.gone .hh-dot { background: var(--muted); }
.hh-ev .hh-t { font-size: 11px; color: var(--muted); }
.hh-user { cursor: pointer; color: var(--text); }
.hh-user:hover { color: var(--primary); }
/* Иконка-переключатель (уведомления, звук): состояние читается по самой иконке, без подписей.
   Включено — акцентная, с мягкой подсветкой; выключено — приглушённая. */
.icon-tgl {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex: none; padding: 0; cursor: pointer;
  border-radius: 9px; border: 1px solid var(--border); background: transparent;
  color: var(--primary); transition: background .15s, border-color .15s, color .15s, opacity .15s;
}
.icon-tgl:hover { background: color-mix(in srgb, var(--primary) 12%, transparent); border-color: var(--primary); }
.icon-tgl .ic { display: block; }
.icon-tgl.off { color: var(--muted); border-color: var(--border); opacity: .75; }
.icon-tgl.off:hover { background: rgba(148,163,184,.1); border-color: var(--muted); color: var(--text); opacity: 1; }
/* Лимит трафика: полоса заполнения лимита (зелёная → жёлтая 90%+ → красная превышение → фиолетовая ограничен) */
.wl-bar { display: flex; align-items: center; gap: 9px; min-width: 190px; }
.wl-bar-track { flex: 1; height: 9px; border-radius: 5px; background: rgba(148,163,184,.16); overflow: hidden; min-width: 90px; }
.wl-bar-fill { height: 100%; border-radius: 5px; transition: width .4s ease; }
.wl-bar-pct { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.wl-acts { display: flex; gap: 5px; flex-wrap: wrap; }
.wl-acts .btn { padding: 3px 8px; font-size: 11px; }
.wl-user:hover { color: var(--primary); }
.badge.b-violet { background: color-mix(in srgb, var(--violet) 18%, transparent); color: var(--violet); }
@media (max-width: 760px) { .wl-bar { min-width: 120px; } .wl-acts { flex-direction: column; } }
/* Важные уведомления (новый абуз / превышение лимита) — СВЕРХУ ПО ЦЕНТРУ.
   Не у края и не внизу: ничего не перекрывает (сайдбар, кнопку выхода), но сразу в поле зрения. */
#ab-alerts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.ab-alert-pop {
  pointer-events: auto;
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  background: var(--panel-2, #161d2b);                       /* плотный фон — текст читается всегда */
  border: 1px solid var(--red); border-left: 5px solid var(--red);
  border-radius: 14px; padding: 13px 16px; min-width: 340px; max-width: 460px;
  box-shadow: 0 14px 40px rgba(0,0,0,.6), 0 0 0 0 rgba(239,68,68,.5);
  animation: abPopIn .28s ease, abPopPulse 1.8s ease-in-out 3;
}
.ab-alert-pop.out { animation: abPopOut .26s ease forwards; }
/* Жёлтый вариант — «подходит к лимиту» (90%+): предупреждение, а не тревога */
.ab-alert-pop.warn {
  background: var(--panel-2, #161d2b);
  border-color: var(--amber); border-left-color: var(--amber);
  box-shadow: 0 14px 40px rgba(0,0,0,.6), 0 0 0 0 rgba(245,158,11,.5);
  animation: abPopIn .28s ease, abPopPulseWarn 1.8s ease-in-out 3;
}
.ab-alert-pop.warn .aap-ic, .ab-alert-pop.warn .aap-go { color: var(--amber); }
@keyframes abPopPulseWarn { 50% { box-shadow: 0 14px 40px rgba(0,0,0,.6), 0 0 0 9px rgba(245,158,11,0); } }
.ab-alert-pop .aap-ic { color: var(--red); display: flex; flex: none; }
.ab-alert-pop .aap-body { min-width: 0; flex: 1; }
.ab-alert-pop .aap-t { font-weight: 700; font-size: 15px; color: var(--text); }
.ab-alert-pop .aap-s { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-alert-pop .aap-go { font-size: 12px; color: var(--red); font-weight: 600; margin-top: 5px; }
.ab-alert-pop .aap-x { background: transparent; border: 0; color: var(--muted); font-size: 15px; cursor: pointer; flex: none; padding: 2px 4px; }
.ab-alert-pop .aap-x:hover { color: var(--text); }
@keyframes abPopIn { from { transform: translateY(-130%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes abPopOut { to { transform: translateY(-130%); opacity: 0; } }
@keyframes abPopPulse { 50% { box-shadow: 0 14px 40px rgba(0,0,0,.6), 0 0 0 9px rgba(239,68,68,0); } }
@media (max-width: 560px) { #ab-alerts { left: 8px; right: 8px; transform: none; top: 8px; } .ab-alert-pop { min-width: 0; max-width: none; width: 100%; } }
/* Счётчик абуза (V3) прямо в меню: видно из любого раздела, пульсирует при появлении нового */
.nav-item { position: relative; }
.nav-badge {
  margin-left: auto; min-width: 20px; height: 19px; padding: 0 6px; border-radius: 10px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 19px;
  text-align: center; font-variant-numeric: tabular-nums; flex: none;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, .55); animation: abBadgePulse 2.4s infinite;
}
@keyframes abBadgePulse {
  0% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); }
  70% { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}
#ab-snd.active { border-color: var(--primary); color: var(--text); }
/* Абуз — рейтинг: заголовок сверху во всю ширину, фильтры аккуратным рядом под ним (не сбоку) */
.ab-rank-head { flex-direction: column; align-items: stretch; gap: 10px; }
.ab-rank-head > h3 { margin: 0; }
.ab-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
@media (max-width: 760px) {
  .ab-filters { gap: 7px; }
  .ab-filters .seg { flex: 1 1 auto; justify-content: center; }
  .ab-filters .seg button { flex: 1 1 auto; }
  .ab-filters #ab-tag { flex: 1 1 46%; max-width: none !important; }
  .ab-filters #ab-ignore-btn { flex: 1 1 46%; }
  .ab-filters .ab-search { flex: 1 1 100%; max-width: none !important; }
  #ab-scroll { max-height: none !important; }
}

/* ---- Тикет-консоль (supnew) ---- */
.sup-wrap { display: grid; grid-template-columns: var(--sup-left, 300px) 10px minmax(0, 1fr) 10px var(--sup-right, 322px); gap: 0; height: calc(100vh - 168px); min-height: 480px; margin-top: 10px; }
.sup-splitter { cursor: col-resize; position: relative; }
.sup-splitter::after { content: ''; position: absolute; left: 4px; right: 4px; top: 0; bottom: 0; border-radius: 3px; transition: background .12s; }
.sup-splitter:hover::after, .sup-splitter:active::after { background: var(--primary); }
.sup-list, .sup-chat, .sup-side { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.sup-list-head { padding: 9px 10px; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.sup-tabs { width: 100%; }
.sup-tabs button { font-size: 11px; padding: 5px 4px; flex: 1; }
.sup-list-body { flex: 1; overflow-y: auto; }
.sup-item { display: flex; gap: 9px; align-items: center; padding: 9px 10px; cursor: pointer; border-bottom: 1px solid var(--border-soft); }
.sup-item:hover { background: var(--panel-2); }
.sup-item.active { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--primary); }
.sup-ava { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 15px; }
.sup-item-main { flex: 1; min-width: 0; }
.sup-item-top { display: flex; justify-content: space-between; gap: 6px; }
.sup-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sup-time { font-size: 11px; flex: 0 0 auto; }
.sup-item-sub { display: flex; gap: 5px; align-items: center; font-size: 12px; margin-top: 2px; }
.sup-last { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sup-last.waiting { color: var(--text); font-weight: 500; }
.sup-item-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: 0 0 auto; }
.sup-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px rgba(245,158,11,.18); }
.sup-num { font-size: 10px; }
.sup-list-foot { padding: 7px 10px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-size: 12px; flex: 0 0 auto; }
.sup-chat-head { padding: 10px 14px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex: 0 0 auto; }
.sup-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.sup-msg { display: flex; max-width: 80%; }
.sup-msg.in { align-self: flex-start; }
.sup-msg.out { align-self: flex-end; }
.sup-msg.note { align-self: center; max-width: 92%; }
.sup-bubble { padding: 8px 11px; border-radius: 13px; font-size: 13px; line-height: 1.42; word-break: break-word; }
.sup-msg.in .sup-bubble { background: var(--panel-2); border-bottom-left-radius: 4px; }
.sup-msg.out .sup-bubble { background: #274b86; border-bottom-right-radius: 4px; }
.sup-msg.note .sup-bubble { background: rgba(245,158,11,.12); border: 1px dashed var(--amber); font-size: 12px; }
.sup-who { font-size: 10px; color: var(--muted); margin-bottom: 2px; }
.sup-msgtime { font-size: 10px; color: var(--muted); margin-top: 3px; text-align: right; }
.sup-photo { max-width: 240px; max-height: 260px; border-radius: 8px; display: block; cursor: pointer; margin-bottom: 3px; }
.sup-sticker { max-width: 140px; max-height: 140px; display: block; cursor: pointer; margin-bottom: 3px; }
/* Анимированный стикер (.tgs → Lottie): контейнер под svg, размер фиксируем — иначе схлопнется в 0. */
.sup-tgs { width: 140px; height: 140px; cursor: default; }
.sup-tgs svg { width: 100% !important; height: 100% !important; }
/* Кастомный (премиум) эмодзи — по строке, вровень с текстом. */
.sup-cemoji { width: 1.25em; height: 1.25em; vertical-align: -0.28em; object-fit: contain; display: inline-block; }
.sup-video { max-width: 280px; max-height: 320px; border-radius: 8px; display: block; margin-bottom: 3px; background: #000; }
.sup-vnote { width: 190px; height: 190px; border-radius: 50%; object-fit: cover; display: block; margin-bottom: 3px; background: #000; }
.sup-audio { display: block; margin-bottom: 3px; max-width: 280px; height: 38px; }
.sup-att { display: inline-block; padding: 5px 9px; background: rgba(255,255,255,.06); border-radius: 8px; color: var(--cyan); font-size: 12px; text-decoration: none; margin-bottom: 3px; }
.sup-compose { border-top: 1px solid var(--border); padding: 8px 10px; flex: 0 0 auto; background: var(--panel); display: flex; flex-direction: column; min-height: 70px; max-height: 72%; overflow: hidden; }
.sup-presets { display: flex; gap: 5px; flex-wrap: wrap; align-content: flex-start; margin-bottom: 7px; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.sup-vsplit { flex: 0 0 auto; height: 9px; cursor: row-resize; position: relative; }
.sup-vsplit::after { content: ''; position: absolute; top: 4px; bottom: 4px; left: 22%; right: 22%; border-radius: 3px; transition: background .12s; }
.sup-vsplit:hover::after, .sup-vsplit:active::after { background: var(--primary); }
.sup-preset { font-size: 11px; padding: 3px 8px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 20px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.sup-preset:hover { border-color: var(--primary); }
.sup-preset-del { color: var(--muted); cursor: pointer; font-weight: 700; }
.sup-preset-del:hover { color: var(--red); }
.sup-compose-row { display: flex; gap: 8px; align-items: flex-end; }
/* Режим заметки («// …»): видно ДО отправки, что это не уйдёт юзеру. */
.sup-compose.note-mode { background: linear-gradient(0deg, rgba(245,158,11,.07), transparent 60%); border-top-color: var(--amber); }
.sup-compose.note-mode textarea { border-color: var(--amber); }
.sup-compose.note-mode #sup-send { background: var(--amber); border-color: var(--amber); color: #1a1206; }
.sup-compose-btns { display: flex; flex-direction: column; gap: 5px; flex: 0 0 auto; }
.sup-side { overflow-y: auto; padding: 12px; gap: 14px; }
.sup-side-h { font-weight: 600; font-size: 13px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.sup-ui-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 4px 0; border-bottom: 1px solid var(--border-soft); }
.sup-note { background: var(--panel-2); border-radius: 8px; padding: 7px 9px; margin-bottom: 6px; font-size: 12px; }
.sup-note-h { display: flex; gap: 6px; align-items: center; font-size: 11px; margin-bottom: 3px; }
.sup-note-h .muted { margin-left: auto; }
.sup-note-del { cursor: pointer; color: var(--muted); font-weight: 700; }
.sup-note-del:hover { color: var(--red); }
.sup-note-add { display: flex; gap: 6px; margin-top: 6px; }
.sup-usert { font-size: 12px; padding: 5px 7px; border-radius: 6px; cursor: pointer; }
.sup-usert:hover { background: var(--panel-2); }
.sup-usert.active { background: var(--panel-2); font-weight: 600; }
.sup-wrap textarea { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 8px 10px; font: inherit; font-size: 13px; width: 100%; }
/* Поле ввода тянут его родной ручкой (полоса-разделитель выше растит область пресетов, а не ввод).
   Только по вертикали: горизонтальная ручка ломала бы раскладку строки. Высота запоминается в JS —
   раньше она слетала при каждой перерисовке композера. */
#sup-text { resize: vertical; min-height: 44px; }
.sup-wrap textarea:focus { outline: none; border-color: var(--primary); }
/* тикеты: цитаты, действия над сообщением (ответить/править/удалить), панель режима ввода */
.sup-quote { border-left: 3px solid var(--primary); background: rgba(129,140,248,.10); border-radius: 5px; padding: 4px 8px; margin-bottom: 5px; font-size: 12px; color: var(--muted); }
.sup-msg .sup-bubble { position: relative; }
.sup-acts { position: absolute; top: -9px; right: 6px; display: flex; gap: 3px; opacity: 0; transition: opacity .12s; z-index: 2; }
.sup-msg:hover .sup-acts { opacity: 1; }
.sup-act { cursor: pointer; font-size: 11px; line-height: 1; padding: 4px 6px; border-radius: 6px; background: var(--panel); border: 1px solid var(--border); user-select: none; }
.sup-act:hover { border-color: var(--primary); background: var(--panel-2); }
.sup-act.off { cursor: default; opacity: .45; }
.sup-act.off:hover { border-color: var(--border); background: var(--panel); }
.sup-replybar { display: flex; align-items: center; gap: 6px; font-size: 12px; background: var(--panel-2); border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: 7px; padding: 5px 9px; margin-bottom: 6px; }
.sup-replybar.edit { border-left-color: var(--amber); }
.sup-replybar .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup-bar-x { margin-left: auto; cursor: pointer; color: var(--muted); font-weight: 700; padding: 0 4px; }
.sup-bar-x:hover { color: var(--red); }
/* контекстное меню по ПКМ (сообщения тикета) */
.ctx-menu { position: fixed; z-index: 10000; min-width: 208px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 5px; box-shadow: 0 16px 44px rgba(0,0,0,.6); font-size: 13px; }
.ctx-item { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.ctx-item:hover { background: color-mix(in srgb, var(--primary) 16%, transparent); }
.ctx-item.danger { color: var(--red); }
.ctx-item.danger:hover { background: rgba(239,68,68,.14); }
.ctx-item.off { opacity: .45; cursor: default; }
.ctx-item.off:hover { background: transparent; }
.ctx-ic { width: 16px; text-align: center; flex: 0 0 auto; }
.ctx-sep { height: 1px; background: var(--border); margin: 4px 2px; }

/* ============================================================================
   VISUAL REFRESH (2026-07-15) — свежая тема: тематичный фон, объёмные панели/KPI,
   премиальные HERO, акценты indigo→violet в стиле Remnawave. Скроллбары.
   Полный откат: удалить этот блок (или восстановить из бэкапа vpn-bi-backup-20260715-043343).
   ============================================================================ */
:root { --glow: rgba(129,140,248,.45); --grad: linear-gradient(135deg,#6366f1,#8b5cf6 55%,#a855f7); }

/* тематичный фон приложения — мягкие цветные свечения, фиксированные */
body {
  background:
    radial-gradient(1100px 560px at 6% -8%, rgba(99,102,241,.14), transparent 56%),
    radial-gradient(920px 640px at 104% 2%, rgba(139,92,246,.12), transparent 55%),
    radial-gradient(780px 780px at 94% 110%, rgba(6,182,212,.06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
.main { background: transparent; }

/* панели — глубина: верхний хайлайт + мягкая тень + лёгкий фиолетовый подмес */
.panel {
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 95%, #6366f1 5%), var(--bg-soft));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 16px 36px -26px rgba(0,0,0,.8);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}

/* KPI — акцентное свечение в фоне карточки + подъём и цветная тень при наведении */
.kpi {
  background:
    radial-gradient(170px 70px at 20% -12%, color-mix(in srgb, var(--accent, var(--primary)) 16%, transparent), transparent 72%),
    linear-gradient(180deg, var(--panel), var(--bg-soft));
  box-shadow: 0 12px 28px -22px rgba(0,0,0,.85);
}
.kpi:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent, var(--primary)) 55%, var(--border));
  box-shadow: 0 18px 34px -18px color-mix(in srgb, var(--accent, var(--primary)) 42%, #000);
}
.kpi-badge { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent, var(--primary)) 26%, transparent); }

/* HERO — премиальный: цветной градиент, свечение бейджа, градиентная цифра */
.kpi.hero {
  background:
    radial-gradient(340px 160px at 86% -26%, color-mix(in srgb, var(--accent) 32%, transparent), transparent 70%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 20%, var(--panel)) 0%, var(--panel) 60%);
  border-color: color-mix(in srgb, var(--accent) 44%, var(--border-soft));
  box-shadow: 0 20px 46px -26px color-mix(in srgb, var(--accent) 62%, #000);
}
.kpi.hero:hover { transform: translateY(-3px); box-shadow: 0 24px 50px -24px color-mix(in srgb, var(--accent) 70%, #000); }
.kpi.hero .kpi-badge {
  background: color-mix(in srgb, var(--accent) 26%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 36%, transparent), 0 10px 24px -8px color-mix(in srgb, var(--accent) 72%, transparent);
}
.kpi.hero .hero-val {
  background: linear-gradient(92deg, #fff, color-mix(in srgb, var(--accent) 58%, #fff));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.kpi.hero .kpi-q { text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 45%, transparent); }

/* активный пункт меню — заметное свечение слева */
.nav-item.active { box-shadow: inset 2px 0 0 var(--primary), 0 6px 20px -12px var(--glow); }
.user-avatar { box-shadow: 0 6px 16px -6px var(--glow); }
/* верхняя панель — тонкая акцентная линия снизу */
.topbar { box-shadow: 0 1px 0 color-mix(in srgb, var(--primary) 20%, transparent); }
/* бренд-иконка с фирменным градиентом */
.brand-mark { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* аккуратные скроллбары в фирменном цвете */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--primary) 34%, var(--border)) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--primary) 32%, var(--border)); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---- типографика (читаемость: крупнее, контрастнее, чётче) и премиум-полировка ---- */
h2, .topbar h2 { letter-spacing: -.3px; font-weight: 760; }
.panel-head h3 { font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
.kpi-label { font-size: 12.5px; font-weight: 500; color: color-mix(in srgb, var(--muted) 76%, var(--text)); }
.kpi-value { letter-spacing: -.6px; font-weight: 780; }
.kpi-sub { font-size: 12px; }
.kpi-q { font-size: 10.5px; letter-spacing: .6px; }
.hint { font-size: 13px; }

/* таблицы — читабельнее и премиальнее */
th { font-size: 11.5px; letter-spacing: .05em; color: color-mix(in srgb, var(--muted) 84%, var(--text)); background: color-mix(in srgb, var(--panel-2) 50%, transparent); padding: 10px 13px; }
td { font-size: 13.5px; padding: 10px 13px; }
tbody tr:hover { background: color-mix(in srgb, var(--primary) 8%, var(--panel-2)); }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--primary); }
.sort-idle { opacity: .28; font-size: 9px; }
.sort-on { font-size: 9px; color: var(--primary); }

/* секционные заголовки — акцентная планка слева (не ломает вёрстку) */
.section-title { position: relative; padding-left: 13px; font-size: 12.5px; color: color-mix(in srgb, var(--muted) 78%, var(--text)); }
.section-title::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 4px; height: 15px; border-radius: 3px; background: var(--grad); box-shadow: 0 0 12px -2px var(--glow); }

/* инпуты/селекты/поиск — премиум-фокус со свечением */
select, .input, input, textarea, .daterange input { font-size: 13.5px; }
select:focus, .input:focus, textarea:focus, .daterange:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.daterange { transition: border-color .15s, box-shadow .15s; }

/* кнопка-праймери и активные сегменты — фирменный градиент */
.btn-primary { background: var(--grad) !important; border-color: transparent !important; color: #fff !important; box-shadow: 0 8px 20px -10px var(--glow); }
.btn-primary:hover { filter: brightness(1.08); }
.seg button.active, .chip-btn.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 14px -6px var(--glow); }
.badge { font-weight: 650; }
.chip-soft { color: color-mix(in srgb, var(--muted) 80%, var(--text)); }

/* мини-спарклайн в KPI (тренд по дням в акцентном цвете) */
/* overflow:visible — halo пульсирует за пределы viewBox, иначе его срежет по краю */
.kpi-spark { display: block; width: 100%; height: 26px; margin-top: 10px; color: var(--accent, var(--primary)); overflow: visible; }
.kpi.hero .kpi-spark { height: 34px; margin-top: 12px; }
/* Точка последнего значения. Толщина задаётся в экранных px (vector-effect в разметке),
   поэтому не плющится вместе с растянутым viewBox. */
.kpi-spark-dot { stroke-width: 4.5px; }
.kpi-spark-halo { stroke-width: 4.5px; opacity: 0; animation: sparkPing 2s cubic-bezier(0, 0, .2, 1) infinite; }
@keyframes sparkPing {
  0%   { stroke-width: 4.5px; opacity: .5; }
  70%  { stroke-width: 15px;  opacity: 0; }
  100% { stroke-width: 15px;  opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .kpi-spark-halo { animation: none; } }
.kpi.has-spark { padding-bottom: 14px; }

/* серверы = строки (по одному в ряд, как ноды Remnawave): имя | бары CPU/RAM/Uptime | ровный ряд метрик */
.srv-cards { display: flex; flex-direction: column; gap: 8px; }
.srv-card { display: flex; align-items: center; gap: 26px; background: linear-gradient(180deg, var(--panel), var(--bg-soft)); border: 1px solid var(--border); border-radius: 12px; padding: 13px 20px; cursor: pointer; transition: border-color .13s, box-shadow .13s, background .13s; }
.srv-card:hover { border-color: var(--primary); box-shadow: 0 10px 26px -18px rgba(0,0,0,.7); background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 92%, var(--primary) 8%), var(--bg-soft)); }
.srv-card-id { flex: 0 0 340px; min-width: 0; }
.srv-card-name { font-weight: 700; font-size: 13.5px; letter-spacing: -.2px; display: flex; align-items: center; gap: 9px; }
.srv-card-name .srv-card-nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srv-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: currentColor; box-shadow: 0 0 8px -1px currentColor; }
.srv-card-meta { font-size: 11px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-left: 18px; }
.srv-bars { flex: 0 0 296px; display: flex; flex-direction: column; gap: 5px; }
.srv-bar { display: grid; grid-template-columns: 52px 1fr 42px; align-items: center; gap: 10px; }
.srv-bar-lbl { font-size: 11px; color: var(--muted); font-weight: 600; }
.srv-bar-track { height: 7px; background: var(--panel-2); border-radius: 5px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.03); }
.srv-bar-fill { height: 100%; border-radius: 5px; transition: width .4s ease; }
.srv-bar-val { font-size: 11.5px; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.srv-card-stats { flex: 1; display: flex; gap: 10px; }
.srv-st { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; min-width: 0; }
.srv-st span { font-size: 10.5px; color: var(--muted); }
.srv-st b { font-size: 14px; white-space: nowrap; }
.srv-psrc { font-size: 9px; margin-left: 4px; }
@media (max-width: 1050px) { .srv-card { flex-wrap: wrap; gap: 14px 20px; } .srv-card-id { flex-basis: 100%; } .srv-bars { flex-basis: 280px; } .srv-card-stats { flex-basis: 100%; } }
.sup-msg .sup-bubble { box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.sup-msg.out .sup-bubble { background: linear-gradient(135deg, #2d539a, #223f74); }
.sup-head-actions { display: flex; gap: 6px; flex: 0 0 auto; align-items: center; }
.sup-datesep { text-align: center; margin: 8px 0 4px; position: sticky; top: 4px; z-index: 3; pointer-events: none; }
.sup-datesep span { font-size: 11px; color: var(--muted); background: var(--panel-2); padding: 2px 12px; border-radius: 10px; }
/* ===== Мини-редактор картинки перед отправкой ===== */
.ime { display: flex; flex-direction: column; gap: 10px; }
.ime-head { display: flex; align-items: center; gap: 10px; }
.ime-hint { margin-left: auto; font-size: 11px; }
.ime-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 7px 9px; }
.ime-seg button { font-size: 12px; }
.ime-colors { display: flex; gap: 5px; }
.ime-c { width: 20px; height: 20px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; box-shadow: 0 0 0 1px rgba(255,255,255,.18) inset; }
.ime-c.active { border-color: var(--primary-2); transform: scale(1.12); }
.ime-w { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.ime-w input { width: 90px; }
.ime-acts { margin-left: auto; display: flex; gap: 6px; }
.ime-acts .btn { padding: 4px 9px; font-size: 12px; }
.ime-acts .btn:disabled { opacity: .4; cursor: default; }
/* Шахматка под картинкой — видно прозрачные края и границы кадра после обрезки. */
.ime-stage { display: flex; justify-content: center; align-items: center; background:
  linear-gradient(45deg, #0d1220 25%, transparent 25%) 0 0/16px 16px,
  linear-gradient(-45deg, #0d1220 25%, transparent 25%) 0 8px/16px 16px,
  linear-gradient(45deg, transparent 75%, #0d1220 75%) 8px -8px/16px 16px,
  linear-gradient(-45deg, transparent 75%, #0d1220 75%) -8px 0/16px 16px, var(--bg-soft);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px; min-height: 260px; overflow: auto; }
.ime-stage canvas { max-width: 100%; border-radius: 4px; box-shadow: 0 6px 22px rgba(0,0,0,.45); }
.ime-foot { display: flex; gap: 8px; align-items: center; }
.ime-foot .input { flex: 1; }
/* Перетаскивание картинки в чат */
.sup-chat.sup-drop { outline: 2px dashed var(--primary); outline-offset: -6px; background: color-mix(in srgb, var(--primary) 7%, transparent); }

/* Таймер в строке списка: сколько тикет ждёт нас / сколько осталось до авто-закрытия. */
.sup-timer { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 8px; white-space: nowrap; }
.sup-timer.st-green { color: var(--green); background: rgba(34,197,94,.12); }
.sup-timer.st-amber { color: var(--amber); background: rgba(245,158,11,.14); }
.sup-timer.st-red   { color: var(--red);   background: rgba(239,68,68,.15); }
.sup-timer.st-mute  { color: var(--muted); background: var(--panel-2); }
.sup-timer.st-warn  { color: var(--violet); background: rgba(139,92,246,.15); }
.sup-more { text-align: center; padding: 10px; font-size: 11px; color: var(--muted); }

/* Системное событие в переписке (тикет закрыт) — заметнее разделителя даты, но не как сообщение. */
.sup-sysline { text-align: center; margin: 10px 0 6px; }
.sup-sysline span { font-size: 11.5px; font-weight: 600; color: var(--amber); background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.32); padding: 3px 12px; border-radius: 10px; }
/* досье */
.sup-alert { font-size: 12px; padding: 7px 9px; border-radius: 8px; margin-bottom: 8px; line-height: 1.35; }
.sup-alert.red { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.4); color: #fca5a5; cursor: pointer; }
.sup-alert.red:hover { background: rgba(239,68,68,.2); }
.sup-alert.amber { background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.4); color: #fcd34d; }
.sup-alert.green { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.4); color: #86efac; }
.sup-doss-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border-soft); border-radius: 8px; overflow: hidden; }
.sup-doss-cell { background: var(--panel); padding: 6px 9px; display: flex; flex-direction: column; gap: 1px; font-size: 13px; }
.sup-doss-cell > span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.sup-hw-h { font-weight: 600; font-size: 12px; margin: 11px 0 6px; }
.sup-hwlist { display: flex; flex-direction: column; gap: 4px; }
.sup-hwrow { display: flex; align-items: center; gap: 7px; font-size: 12px; padding: 4px 8px; border-radius: 6px; background: var(--panel-2); }
.sup-hwrow > :last-child { margin-left: auto; }
.sup-hwrow.clickable { cursor: pointer; }
.sup-hwrow.clickable:not(.shared):hover { box-shadow: inset 0 0 0 1px var(--primary); background: var(--panel); }
.sup-hwrow.shared { background: rgba(239,68,68,.1); cursor: pointer; }
.sup-hwrow.shared:hover { background: rgba(239,68,68,.18); }
.sup-doss-actions { display: flex; gap: 6px; margin-top: 11px; }
.sup-preset-manage { border-style: dashed; color: var(--muted); }
/* менеджер пресетов */
.pm-item { border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-bottom: 10px; background: var(--panel-2); }
.pm-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.pm-row .input { flex: 1; }
.pm-item textarea { width: 100%; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 8px; font: inherit; font-size: 13px; resize: vertical; }
.pm-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; }
.pm-add { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }
.pm-add textarea { resize: vertical; }
/* Планшет/телефон (≤1100): правый боковик скрыт в потоке, но доступен оверлеем по кнопке «Инфо».
   Так панель управления Remnawave остаётся достижимой на узких экранах. */
@media (max-width: 1100px) {
  .sup-wrap { grid-template-columns: var(--sup-left, 260px) 10px minmax(0, 1fr); position: relative; }
  .sup-wrap:not(.sup-show-side) .sup-side, .sup-splitter[data-sp="right"] { display: none; }
  .sup-info-btn, .sup-side-back { display: inline-flex; }
  .sup-wrap.sup-show-side .sup-side {
    display: flex !important; position: absolute; inset: 0; z-index: 30; width: 100%; height: 100%;
    overflow-y: auto; background: var(--bg); padding: 12px; gap: 12px;
  }
  .rw-panel .g2 { grid-template-columns: 1fr; }   /* сквады/параметры в один столбец */
}
/* Кнопки «назад к списку», «инфо», «к переписке» и тоггл пресетов — только на узких экранах */
.sup-back, .sup-presets-toggle, .sup-info-btn, .sup-side-back { display: none; }
@media (max-width: 760px) {
  /* Телефон: один экран за раз — либо список тикетов, либо открытый чат (переключение кнопкой «назад») */
  .sup-wrap { display: block; height: calc(100dvh - 128px); min-height: 340px; margin-top: 8px; }
  .sup-splitter, .sup-vsplit { display: none !important; }
  .sup-list, .sup-chat { height: 100%; width: 100%; }
  .sup-chat { display: none; }
  .sup-wrap.sup-show-chat .sup-list { display: none; }
  .sup-wrap.sup-show-chat .sup-chat { display: flex; }
  .sup-list { max-height: none; }
  .sup-msgs { min-height: 0; flex: 1 1 auto; }
  .sup-msg { max-width: 86%; }
  .sup-back { display: inline-flex; padding: 5px 8px; }
  .sup-chat-head { padding: 8px 10px; gap: 6px; }
  .sup-head-actions { gap: 5px; flex: 0 0 auto; }
  /* Композер: фикс высота, поле ввода видно, кнопки в ряд под ним */
  .sup-compose { max-height: none !important; height: auto !important; padding: 8px; gap: 6px; }
  .sup-compose-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .sup-compose-row textarea { width: 100%; min-height: 108px; line-height: 1.4; }
  .sup-compose-btns { flex-direction: row; flex-wrap: nowrap; justify-content: flex-end; gap: 6px; }
  .sup-compose-btns .btn-primary { flex: 1; }
  .sup-presets-toggle { display: inline-flex; }
  /* Пресеты свёрнуты по умолчанию, разворот кнопкой */
  .sup-presets { max-height: 0; margin: 0 0 0 0; overflow: hidden; transition: max-height .22s ease; flex: 0 0 auto; }
  .sup-compose.presets-open .sup-presets { max-height: 38vh; margin-bottom: 7px; overflow-y: auto; }
}

/* ===== Emoji-пикер ===== */
.emoji-pop { position: fixed; z-index: 400; width: 300px; height: 300px; display: flex; flex-direction: column; background: var(--panel-2); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.5); overflow: hidden; }
.emoji-tabs { display: flex; gap: 2px; padding: 6px 6px 0; border-bottom: 1px solid var(--border-soft); flex-wrap: wrap; }
.emoji-tab { background: transparent; border: none; font-size: 17px; padding: 5px 7px; border-radius: 8px 8px 0 0; cursor: pointer; opacity: .6; line-height: 1; transition: all .12s; }
.emoji-tab:hover { opacity: 1; background: var(--panel); }
.emoji-tab.active { opacity: 1; background: var(--panel); box-shadow: inset 0 -2px 0 var(--primary, #6366f1); }
.emoji-search { background: var(--bg-soft); border: 1px solid var(--border); color: var(--text); padding: 6px 10px; border-radius: 9px; outline: none; font-size: 13px; }
.emoji-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 6px 8px; align-content: start; }
.emoji-cell { background: transparent; border: none; font-size: 20px; padding: 3px; border-radius: 8px; cursor: pointer; line-height: 1.1; transition: background .1s, transform .05s; }
.emoji-cell:hover { background: var(--panel); transform: scale(1.15); }
.emoji-cell:active { transform: scale(.95); }

/* Переключатель звука в шапке списка тикетов. */
.sup-snd { cursor: pointer; font-size: 14px; padding: 0 2px; user-select: none; line-height: 1; }
.sup-snd.off { opacity: .45; filter: grayscale(1); }
.sup-snd:hover { transform: scale(1.15); }

/* Вторая оценка рядом с основной: видно, где V1 и V2 расходятся, и на сколько. */
.ab-alt { font-size: 9.5px; font-weight: 700; margin-top: 3px; opacity: .75; letter-spacing: .2px; }
.ab-alt span { margin-left: 3px; padding: 0 3px; border-radius: 4px; }
.ab-alt.up span { color: var(--red); background: rgba(239,68,68,.14); }
.ab-alt.down span { color: var(--green); background: rgba(34,197,94,.14); }
/* Наказанный абуз: правило «сейчас» даёт 0, показываем пик из памяти детекта. Приглушённо-фиолетовый —
   не тревога (уже отработали), но и не «чисто»: видно, что тут был абуз и его закрыли. */
.ab-alt.done { color: var(--violet, #a78bfa); opacity: .9; cursor: help; }
/* Рецидив: уже банили на устройстве, а он снова завёл живую FREE — ярче обычного абуза. */
.ab-alt.recid { color: var(--red); opacity: 1; font-weight: 800; }

/* Актуальность данных в шапке: кружок + время. Серый — из кэша, синий пульс — обновляю, зелёная вспышка — обновилось. */
.swr { display: flex; align-items: center; gap: 6px; margin-left: auto; font-size: 11px; color: var(--muted); cursor: pointer; white-space: nowrap; padding: 3px 8px; border-radius: 999px; border: 1px solid transparent; }
.swr:hover { border-color: var(--border); background: var(--panel-2); }
.swr-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.swr-dot.busy { background: var(--primary-2); animation: swrpulse 1s ease-in-out infinite; }
.swr-dot.new { background: var(--green); box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: swrflash 1.4s ease-out 1; }
@keyframes swrpulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.75); } }
@keyframes swrflash { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.65); } 100% { box-shadow: 0 0 0 9px rgba(34,197,94,0); } }

/* ===== Мобилка: уведомления не должны закрывать пол-экрана ===== */
@media (max-width: 760px) {
  .toasts { bottom: 8px; right: 8px; left: 8px; gap: 6px; }
  .toast {
    max-width: none; width: 100%; font-size: 12px; padding: 7px 11px;
    border-radius: 9px; opacity: .96;
  }
  /* Больше двух одновременно — это уже стена: старые прячем. */
  .toasts .toast:nth-last-child(n+3) { display: none; }
  /* Всплывашки абуза не на весь экран */
  #ab-alerts { max-height: 42vh; overflow-y: auto; }
}
/* Совсем выключить уведомления (тумблер в Настройках) */
body.no-toasts .toasts { display: none !important; }
body.no-toasts #ab-alerts { display: none !important; }

/* ===== Мобилка: свернуть период/гранулярность ===== */
.fb-toggle { display: none; }
@media (max-width: 760px) {
  .fb-toggle {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px;
    border: 1px solid var(--border); background: var(--panel); color: inherit;
    border-radius: 9px; font-size: 12px; cursor: pointer;
  }
  .filterbar.collapsed > *:not(.fb-toggle) { display: none; }
  .filterbar { gap: 6px; }
}

/* ===== Мобилка: делаем разделы реально пригодными с телефона ===== */
@media (max-width: 760px) {
  /* Тикеты: сетка из 5 колонок на телефоне нерабочая. Показываем РОВНО ОДНУ панель:
     список -> переписка -> досье. Классы sup-show-chat / sup-show-side ставит сам код
     тикетов (кнопки «Инфо» и «назад») — здесь только описано, что при них видно.
     Раньше учитывался лишь чат, поэтому «Инфо» не открывало управление пользователем. */
  .sup-wrap { display: block; height: auto; min-height: 0; }
  .sup-splitter, .sup-vsplit { display: none !important; }
  .sup-list, .sup-chat, .sup-side {
    width: 100% !important; max-width: none !important; margin: 0;
  }

  /* по умолчанию — только список тикетов */
  .sup-wrap .sup-chat, .sup-wrap .sup-side { display: none !important; }
  .sup-wrap .sup-list { display: flex !important; }
  .sup-list-body { max-height: calc(100dvh - 210px); }

  /* открыт тикет — только переписка, во весь экран */
  .sup-wrap.sup-show-chat .sup-list { display: none !important; }
  .sup-wrap.sup-show-chat .sup-chat { display: flex !important; height: calc(100dvh - 150px); }
  .sup-wrap.sup-show-chat .sup-chat-body { flex: 1; max-height: none; }

  /* открыто досье — только оно, там управление пользователем */
  .sup-wrap.sup-show-side .sup-list, .sup-wrap.sup-show-side .sup-chat { display: none !important; }
  .sup-wrap.sup-show-side .sup-side { display: flex !important; height: calc(100dvh - 150px); overflow-y: auto; }

  /* Поле ввода было крошечным: композер тянул высоту, сохранённую с десктопа. */
  #sup-compose { height: auto !important; min-height: 0; }
  #sup-text { min-height: 76px; font-size: 15px; }   /* 15px — iOS не зумит поле при фокусе */
  .sup-compose-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .sup-compose-btns { display: flex; gap: 6px; justify-content: space-between; }
  .sup-compose-btns .btn { flex: 1; padding: 9px 6px; }
  .sup-compose-btns .btn-primary { flex: 2; }

  /* Пресеты свёрнуты, по кнопке разворачиваются полосой со скроллом */
  .sup-presets { display: none; }
  #sup-compose.presets-open .sup-presets { display: flex; max-height: 96px; overflow-y: auto; margin-bottom: 6px; }
  .sup-preset { font-size: 12px; padding: 6px 10px; }

  .sup-tabs button { font-size: 11px; padding: 7px 3px; }
  .sup-item { padding: 11px 10px; }        /* попадать пальцем, а не мышью */
  .sup-side-sec { margin-bottom: 14px; }
  .sup-info-btn { padding: 8px 10px; }

  /* Абуз: длинные диаграммы и таблицы — горизонтальный скролл внутри своего блока */
  .ab-gt, .ab-gt-row { min-width: 0; }
  .ab-gt-lbl { width: 96px; flex: 0 0 96px; font-size: 11px; }
  .ab-gt-legend { font-size: 10px; gap: 9px; }
  #ab-scroll, .ab-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Таблицы: не ломают страницу, скроллятся сами */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 560px; }
  .table-wrap th, .table-wrap td { padding: 7px 8px; font-size: 12px; }

  /* Сетки — в одну колонку, KPI — по две */
  .grid, .grid.g2, .grid.g-2-1, .grid.g3 { grid-template-columns: 1fr !important; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .kpi.hero { grid-column: span 2; }

  /* Панели и графики по ширине экрана */
  .panel { min-width: 0; }
  .chart-box { height: 220px; }
  .panel-head { flex-wrap: wrap; gap: 6px; }
  .panel-head h3 { font-size: 13px; }

  /* Модалки на весь экран */
  #modal { width: calc(100vw - 16px) !important; max-height: 88vh; overflow-y: auto; }

  /* Под-вкладки групп — переносим, а не режем */
  .seg { flex-wrap: wrap; }
  .seg button { flex: 1 1 auto; }

  /* Массовые действия шадоу-бана */
  .sh-bulk { position: sticky; top: 0; background: var(--bg); z-index: 2; }
}

/* ===== Истёкшие подписки: карточки-фильтры на дашборде ===== */
.exp-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.exp-card {
  text-align: left; padding: 10px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--panel-2); color: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.exp-card:hover { border-color: var(--primary); }
.exp-card.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; background: color-mix(in srgb, var(--primary) 10%, transparent); }
.exp-lbl { font-size: 11px; color: var(--muted); }
.exp-num { font-size: 21px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.exp-sub { font-size: 11px; }
@media (max-width: 760px) {
  .exp-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exp-num { font-size: 18px; }
}

/* Пресет, похожий на тему обращения. Подсказка мягкая: рамка и лёгкий фон,
   без крика — оператор всё равно решает сам. */
.sup-preset-hit {
  border-color: var(--primary) !important;
  background: color-mix(in srgb, var(--primary) 14%, transparent) !important;
  color: var(--text);
}
.sup-preset-hit::before { content: '• '; color: var(--primary); }

/* ===== ✨ ИИ-подсказка ответа оператору ===== */
.sup-ai { border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border)); border-radius: 10px; background: linear-gradient(135deg, rgba(16,185,129,.09), rgba(59,130,246,.035)); padding: 7px 9px; margin-bottom: 7px; flex: 0 0 auto; opacity: .72; transition: opacity .18s ease, border-color .18s ease, box-shadow .18s ease; }
.sup-ai:hover, .sup-ai:focus-within { opacity: 1; border-color: color-mix(in srgb, var(--primary) 54%, var(--border)); box-shadow: 0 8px 24px rgba(0,0,0,.10); }
.sup-compose.ai-dismissed .sup-ai { display: none; }
.sup-ai-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sup-ai-title { font-size: 12px; font-weight: 600; color: var(--primary); }
.sup-ai-ready { font-size: 10px; color: var(--muted); }
.sup-ai-gen { font-size: 12px; padding: 3px 10px; }
.sup-ai-gen { margin-left: auto; }
.sup-ai-body { margin-top: 7px; }
.sup-ai-body.hidden { display: none; }
.sup-ai-load { font-size: 12px; color: var(--muted); }
.sup-ai-err { font-size: 12px; color: var(--amber, #f59e0b); }
.sup-ai-text { font-size: 13px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; color: var(--text); max-height: 200px; overflow-y: auto; }
.sup-ai-ghost { cursor: pointer; outline: none; position: relative; }
.sup-ai-ghost .sup-ai-text { max-height: 48px; overflow: hidden; color: color-mix(in srgb, var(--text) 76%, transparent); transition: max-height .24s ease, color .18s ease; }
.sup-ai-ghost:hover .sup-ai-text, .sup-ai-ghost:focus .sup-ai-text { max-height: 220px; overflow-y: auto; color: var(--text); }
.sup-ai-accept { position: absolute; right: 7px; bottom: 5px; font-size: 9px; color: var(--primary); background: color-mix(in srgb, var(--panel-2) 88%, transparent); border-radius: 999px; padding: 2px 6px; opacity: 0; transition: opacity .15s; pointer-events: none; }
.sup-ai-ghost:hover .sup-ai-accept, .sup-ai-ghost:focus .sup-ai-accept { opacity: 1; }
.sup-ai-context { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.sup-ai-context span { font-size: 10px; line-height: 1.25; color: var(--muted); border: 1px solid var(--border); background: color-mix(in srgb, var(--panel-2) 88%, var(--primary) 12%); border-radius: 999px; padding: 2px 6px; white-space: nowrap; }
.sup-ai-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.sup-ai-context, .sup-ai-acts { max-height: 0; opacity: 0; overflow: hidden; margin-top: 0; transition: max-height .2s ease, opacity .16s ease, margin .2s ease; }
.sup-ai:hover .sup-ai-context, .sup-ai:focus-within .sup-ai-context, .sup-ai:hover .sup-ai-acts, .sup-ai:focus-within .sup-ai-acts { max-height: 90px; opacity: 1; margin-top: 6px; }
.sup-ai-acts .btn { font-size: 11px; padding: 3px 9px; }
.sup-ai-meta { font-size: 10px; color: var(--muted); margin-left: auto; }
.sup-draft-state { color: var(--red); font-size: 10px; font-weight: 600; margin: -1px 0 4px 2px; }
.sup-drafts-tab { color: var(--red) !important; }
.sup-draft-label { color: var(--red); font-weight: 700; }
.sup-item.has-draft { box-shadow: inset 2px 0 0 color-mix(in srgb, var(--red) 78%, transparent); }
@media (prefers-reduced-motion: reduce) {
  .sup-ai, .sup-ai-ghost .sup-ai-text, .sup-ai-accept, .sup-ai-context, .sup-ai-acts { transition: none !important; }
}
/* тач-ресайз разделителей тикет-консоли (иначе на телефоне/планшете браузер скроллит вместо перетаскивания) */
.sup-splitter, .sup-vsplit { touch-action: none; }
@media (max-width: 760px) {
  .sup-ai { margin: 0 0 6px 0; }
  .sup-ai-text { max-height: 42vh; font-size: 14px; }
  .sup-ai-ghost .sup-ai-text { max-height: 72px; }
  .sup-ai-context, .sup-ai-acts { max-height: 100px; opacity: 1; margin-top: 6px; }
  .sup-ai-acts .btn { flex: 1 1 auto; min-width: 64px; }
  .sup-ai-acts .sup-ai-ins { flex-basis: 100%; }
}

/* Мобилка/планшет: кнопка «Инфо» (правая панель пользователя: устройства, абуз, управление) должна быть видна — перекрываем display:none десктопного дефолта, который шёл позже по каскаду */
@media (max-width: 1100px) { .sup-info-btn, .sup-side-back { display: inline-flex !important; } }


/* ── Журнал действий: флаги, сети, устройства ── */
.uc-flag{width:18px;height:13px;object-fit:cover;border-radius:2px;vertical-align:-2px;box-shadow:0 0 0 1px rgba(0,0,0,.15)}
.uc-flag-none{font-size:12px}
.panel-sub{margin-bottom:12px;padding:10px 12px;background:var(--bg2);border-radius:8px}
.ulog-sum{display:flex;gap:22px;flex-wrap:wrap;align-items:baseline;margin-bottom:6px}
.ulog-sum b{font-size:16px}
.ulog-lbl{display:block;font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}
.ulog-net-head{display:grid;grid-template-columns:14px 22px 1fr 80px 100px 120px;gap:8px;align-items:center;padding:5px 0;border-bottom:1px solid var(--border);cursor:pointer;font-size:12px}
.ulog-net-head:hover{background:rgba(255,255,255,.03)}
.ulog-caret{color:var(--muted);font-size:10px}
.ulog-net-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ulog-net-n{text-align:right;font-variant-numeric:tabular-nums;font-size:11.5px}
.ulog-net-body{padding:4px 0 8px 36px}
.ulog-ip-row{display:grid;grid-template-columns:130px 1fr 150px 60px 110px;gap:8px;padding:3px 0;border-bottom:1px solid var(--border);font-size:11.5px;align-items:baseline}
.ulog-dev-row{display:grid;grid-template-columns:1.4fr .8fr .9fr 1.2fr 100px 100px;gap:8px;padding:4px 0;border-bottom:1px solid var(--border);font-size:12px;align-items:baseline}
.ulog-dev-head{font-size:10px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}
.ulog-dev-model{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ulog-dev-dt{font-size:11px;text-align:right}
.ulog-dev-row .copy-hwid{cursor:pointer;font-size:11px;overflow:hidden;text-overflow:ellipsis}
