/* «Свои»: раскладка и цвета в духе Telegram, движение и материалы — по правилам Apple
   (отклик на нажатие сразу, полупрозрачные шапки, окна двигаются пружиной и их можно перехватить). */
:root {
  --bg: #ffffff;
  --side-bg: #ffffff;
  --chat-bg: #d6e2c8;
  --panel: #ffffff;
  --glass: rgba(255, 255, 255, .78);
  --text: #000000;
  --muted: #8a8a8e;
  --line: #e7e7e9;
  --accent: #3390ec;
  --accent-soft: rgba(51, 144, 236, .1);
  --mine: #e2fec9;
  --mine-text: #000000;
  --mine-meta: #45a845;
  --theirs: #ffffff;
  --theirs-text: #000000;
  --theirs-meta: #a1aab3;
  --badge: #3390ec;
  --online: #4fbe4f;
  --green: #34c759;
  --red: #ff3b30;
  --pill-bg: rgba(0, 0, 0, .22);
  --hover: #f4f4f5;
  --active: #e9f2fd;
  --input: #f1f1f4;
  --group: #f2f2f7;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1621;
    --side-bg: #17212b;
    --chat-bg: #0e1621;
    --panel: #17212b;
    --glass: rgba(23, 33, 43, .8);
    --text: #f5f5f5;
    --muted: #7f91a4;
    --line: #0b131b;
    --accent: #5eb5f7;
    --accent-soft: rgba(94, 181, 247, .12);
    --mine: #2b5278;
    --mine-text: #f5f5f5;
    --mine-meta: #7da8d3;
    --theirs: #182533;
    --theirs-text: #f5f5f5;
    --theirs-meta: #6d7f8f;
    --badge: #3e88c9;
    --pill-bg: rgba(0, 0, 0, .35);
    --hover: #202b36;
    --active: #2b5278;
    --input: #242f3d;
    --group: #0e1621;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
svg { width: 24px; height: 24px; fill: currentColor; }
svg.stroke { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
/* отклик в момент нажатия, а не после */
button:active, .contacts li:active, .row:active { transition: transform 80ms ease-out, background-color 80ms; }

/* ---------- раскладка ---------- */
.app { height: 100dvh; display: grid; grid-template-columns: 100%; position: relative; overflow: hidden; }
.side, .main { min-width: 0; height: 100dvh; position: relative; }
.side { background: var(--side-bg); }
.main { background: var(--chat-bg); }
.pane { height: 100%; display: flex; flex-direction: column; }
.scroll { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.placeholder { height: 100%; display: grid; place-items: center; }
.placeholder span { background: var(--pill-bg); color: #fff; padding: 4px 12px; border-radius: 999px; font-size: 14px; }

/* телефон: одна колонка, переписка поверх списка */
@media (max-width: 799px) {
  .app .main { position: absolute; inset: 0; transform: translateX(100%); visibility: hidden;
    transition: transform .32s cubic-bezier(.2, .8, .2, 1), visibility 0s .32s; }
  .app.in-chat .main { transform: none; visibility: visible; transition: transform .32s cubic-bezier(.2, .8, .2, 1); }
  .placeholder { display: none; }
}
/* компьютер: чаты слева, переписка справа */
@media (min-width: 800px) {
  .app { grid-template-columns: minmax(300px, 380px) 1fr; }
  .side { border-right: 1px solid var(--line); }
  #back { display: none; }
}
@media (min-width: 1300px) { .app { grid-template-columns: 420px 1fr; } }
/* управление на компьютере шире: таблицы и графики */
@media (min-width: 1000px) { .app.admin-open { grid-template-columns: minmax(560px, 52vw) 1fr; } }
@media (prefers-reduced-motion: reduce) { .app .main, .app.in-chat .main { transition: none; } }

/* ---------- шапки: полупрозрачный материал ---------- */
.bar {
  display: flex; align-items: center; gap: 2px;
  padding: calc(var(--safe-top) + 4px) 6px 4px;
  min-height: 52px; position: relative; z-index: 3;
  border-bottom: .5px solid var(--line);
}
.glass { background: var(--glass); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); }
@media (prefers-reduced-transparency: reduce) { .glass { background: var(--panel); backdrop-filter: none; } }
.bar h1 { flex: 1; text-align: center; font-size: 17px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.icon {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 50%; color: var(--accent); flex: none;
}
.icon:active { background: var(--hover); transform: scale(.94); }
.who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left; padding: 2px 6px; border-radius: 10px; }
.who:active { background: var(--hover); }
.who-text { display: flex; flex-direction: column; min-width: 0; }
.who .name { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .status { font-size: 13px; color: var(--muted); }
.who .status.on { color: var(--accent); }

/* ---------- аватары ---------- */
.avatar {
  width: 54px; height: 54px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 600; font-size: 20px; color: #fff;
  position: relative; letter-spacing: .3px;
}
.avatar.sm { width: 38px; height: 38px; font-size: 15px; }
.avatar.md { width: 42px; height: 42px; font-size: 16px; }
.avatar.lg { width: 92px; height: 92px; font-size: 34px; }
.avatar.xl { width: 120px; height: 120px; font-size: 44px; }
.avatar.on::after {
  content: ""; position: absolute; right: 1px; bottom: 1px; width: 13px; height: 13px;
  border-radius: 50%; background: var(--online); border: 2.5px solid var(--side-bg);
}
.avatar.sm.on::after, .avatar.md.on::after { width: 10px; height: 10px; border-width: 2px; }

.banner {
  margin: 8px 10px; padding: 10px 12px; border-radius: 12px;
  background: var(--input); font-size: 14px; display: flex; gap: 10px; align-items: center;
}
.banner p { margin: 0; flex: 1; }

/* ---------- список чатов ---------- */
.contacts { list-style: none; margin: 0; padding: 0; }
.contacts li { display: flex; gap: 12px; align-items: center; padding: 8px 12px; cursor: pointer; position: relative; }
.contacts li:hover { background: var(--hover); }
.contacts li:active { background: var(--hover); transform: scale(.995); }
.contacts li.active { background: var(--active); }
.contacts li.active .c-time, .contacts li.active .c-last { color: inherit; opacity: .75; }
@media (prefers-color-scheme: dark) { .contacts li.active { color: #fff; } }
.contacts li::after { content: ""; position: absolute; left: 78px; right: 0; bottom: 0; border-bottom: .5px solid var(--line); }
.c-main { flex: 1; min-width: 0; }
.c-top { display: flex; gap: 8px; align-items: baseline; }
.c-name { font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-time { font-size: 13px; color: var(--muted); }
.c-bottom { display: flex; gap: 8px; align-items: center; margin-top: 2px; }
.c-last { color: var(--muted); font-size: 15px; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.badge { background: var(--badge); color: #fff; border-radius: 999px; min-width: 22px; height: 22px; padding: 0 7px; font-size: 13px; font-weight: 600; display: grid; place-items: center; }
.empty { color: var(--muted); text-align: center; padding: 32px 24px; }

/* ---------- профиль и участники: сгруппированные списки ---------- */
.settings { background: var(--group); padding: 0 0 calc(var(--safe-bottom) + 24px); }
.me-card { text-align: center; padding: 22px 16px 14px; background: var(--side-bg); }
.me-card .avatar { margin: 0 auto 10px; }
.me-card .me-name { font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.me-card .me-handle { color: var(--accent); font-size: 15px; margin-top: 2px; }
.group-title { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; padding: 18px 16px 6px; }
.group { background: var(--side-bg); }
.group-hint { font-size: 13px; color: var(--muted); padding: 6px 16px 0; line-height: 1.4; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 11px 16px; min-height: 46px; position: relative; background: var(--side-bg);
}
.row + .row::before { content: ""; position: absolute; left: 16px; right: 0; top: 0; border-top: .5px solid var(--line); }
button.row:hover { background: var(--hover); }
button.row:active { background: var(--hover); }
.row .r-main { flex: 1; min-width: 0; }
.row .r-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .r-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .r-side { color: var(--muted); font-size: 14px; flex: none; }
.row.link { color: var(--accent); }
.row.danger { color: var(--red); }
.row .r-btn { color: var(--accent); font-size: 14px; font-weight: 500; padding: 6px 4px; flex: none; }
.row .r-btn.danger { color: var(--red); }
.row input { flex: 1; background: transparent; border: 0; padding: 0; font: inherit; color: var(--text); outline: none; min-width: 0; }
.row .prefix { color: var(--muted); flex: none; }
.row.indent-1 { padding-left: 40px; } .row.indent-2 { padding-left: 64px; } .row.indent-3 { padding-left: 88px; } .row.indent-4 { padding-left: 112px; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; color: #fff; background: var(--accent); border-radius: 6px; padding: 1px 6px; margin-left: 6px; vertical-align: 1px; }
.tag.grey { background: var(--muted); }

/* ---------- переписка ---------- */
.messages { flex: 1; overflow-y: auto; padding: 8px 8px 6px; display: flex; flex-direction: column; gap: 2px; -webkit-overflow-scrolling: touch; }
.messages > * { width: 100%; max-width: 760px; margin-left: auto; margin-right: auto; }
.day { align-self: center; width: auto !important; font-size: 13px; font-weight: 500; color: #fff; background: var(--pill-bg); padding: 2px 9px; border-radius: 999px; margin: 8px auto 6px !important; position: sticky; top: 4px; z-index: 1; }
.msg { width: fit-content !important; max-width: min(78%, 520px) !important; padding: 6px 9px 6px 10px; border-radius: 16px; word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap; position: relative; box-shadow: 0 1px 1px rgba(0, 0, 0, .12); font-size: 16px; }
.msg.mine { margin-right: max(0px, calc((100% - 760px) / 2)) !important; margin-left: auto !important; background: var(--mine); color: var(--mine-text); }
.msg.theirs { margin-left: max(0px, calc((100% - 760px) / 2)) !important; margin-right: auto !important; background: var(--theirs); color: var(--theirs-text); }
.msg.gap { margin-top: 6px; }
.msg.mine.tail { border-bottom-right-radius: 4px; }
.msg.theirs.tail { border-bottom-left-radius: 4px; }
.msg a { color: var(--accent); }
.msg.mine a { color: inherit; }
.msg .meta { float: right; font-size: 12px; margin: 7px -2px -5px 10px; white-space: nowrap; display: inline-flex; align-items: center; gap: 2px; line-height: 1; }
.msg.mine .meta { color: var(--mine-meta); }
.msg.theirs .meta { color: var(--theirs-meta); }
.ticks { width: 16px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.msg.image { padding: 0; overflow: hidden; background: transparent; }
.msg.image img { display: block; max-width: 100%; max-height: 380px; min-width: 120px; cursor: zoom-in; }
.msg.image .meta { position: absolute; right: 6px; bottom: 6px; margin: 0; float: none; background: rgba(0, 0, 0, .45); color: #fff; padding: 3px 6px; border-radius: 10px; }
.msg.calllog { display: flex; gap: 8px; align-items: center; white-space: normal; padding-right: 10px; }
.msg.calllog .callicon { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.msg.calllog .callicon svg { width: 18px; height: 18px; }
.msg.calllog .calltext { display: flex; flex-direction: column; }
.msg.calllog .calltext small { color: var(--muted); font-size: 13px; }
.msg.calllog.missed small { color: var(--red); }
.msg.calllog .meta { align-self: flex-end; }

.composer { display: flex; align-items: flex-end; gap: 2px; padding: 6px 6px calc(var(--safe-bottom) + 6px); border-top: .5px solid var(--line); }
.composer > * { flex: none; }
.composer .attach { color: var(--muted); cursor: pointer; }
.composer textarea { flex: 1; resize: none; border: 0; border-radius: 20px; padding: 10px 14px; font: inherit; font-size: 16px; line-height: 1.3; background: var(--input); color: var(--text); max-height: 140px; outline: none; }
.send { width: 42px; height: 42px; border-radius: 50%; color: var(--accent); display: grid; place-items: center; }
.send:active { transform: scale(.9); }
.send svg { width: 26px; height: 26px; }

.callbar { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 14px; background: var(--green); color: #fff; font-size: 14px; font-weight: 500; }
.callbar .dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: pulse 1.6s ease-in-out infinite; }
.callbar span:nth-child(2) { flex: 1; text-align: left; }
.callbar-go { opacity: .9; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .callbar .dot { animation: none; } }

/* ---------- звонок ---------- */
.call { position: fixed; inset: 0; z-index: 50; color: #fff; background: #10161d; overflow: hidden; touch-action: none; }
.tile { position: absolute; background: #000; overflow: hidden; }
.tile video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.tile-avatar { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(160deg, #3f6f9a, #24425e 60%, #1b3147); }
#tileRemote.has-video .tile-avatar { display: none; }
#tileSelf.no-video { display: none; }

/* основной вид: собеседник на весь экран, я — в плавающем окне */
.call.mode-pip #tileRemote, .call.mode-swap #tileSelf { inset: 0; border-radius: 0; z-index: 1; }
.call.mode-pip #tileSelf, .call.mode-swap #tileRemote {
  z-index: 4; border-radius: 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, .45); cursor: grab; will-change: transform;
  left: 0; top: 0; /* положение задаётся transform из кода */
}
.call.mode-pip #tileSelf:active, .call.mode-swap #tileRemote:active { cursor: grabbing; }
/* рядом: две равные половины */
.call.mode-split #tileRemote, .call.mode-split #tileSelf { top: 0; bottom: 0; width: 50%; z-index: 1; transform: none !important; }
.call.mode-split #tileRemote { left: 0; } .call.mode-split #tileSelf { left: 50%; border-left: 2px solid #10161d; }
@media (orientation: portrait) {
  .call.mode-split #tileRemote, .call.mode-split #tileSelf { width: 100%; height: 50%; left: 0; bottom: auto; }
  .call.mode-split #tileSelf { top: 50%; border-left: 0; border-top: 2px solid #10161d; }
}
.resize { display: none; position: absolute; right: 0; bottom: 0; width: 28px; height: 28px; cursor: nwse-resize; touch-action: none; }
.resize::after { content: ""; position: absolute; right: 6px; bottom: 6px; width: 10px; height: 10px; border-right: 2.5px solid rgba(255, 255, 255, .85); border-bottom: 2.5px solid rgba(255, 255, 255, .85); border-bottom-right-radius: 3px; }
.call.mode-pip #tileSelf .resize { display: block; }
.call.mode-swap #tileRemote::after { content: none; }

.call-top { position: absolute; left: 0; right: 0; top: 0; z-index: 5; display: flex; align-items: flex-start; gap: 10px; padding: calc(var(--safe-top) + 12px) 14px 30px; background: linear-gradient(rgba(0, 0, 0, .45), transparent); pointer-events: none; }
.call-top > * { pointer-events: auto; }
.call-info { flex: 1; text-align: center; text-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
.call-name { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.call-state { font-size: 15px; opacity: .85; margin-top: 2px; font-variant-numeric: tabular-nums; }
.call:not(.has-remote-video) .call-info { margin-top: 0; }
.call-controls { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; justify-content: center; gap: 18px; padding: 40px 16px calc(var(--safe-bottom) + 26px); background: linear-gradient(transparent, rgba(0, 0, 0, .55)); flex-wrap: wrap; }
.round { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .2); color: #fff; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); position: relative; flex: none; }
.round:active { transform: scale(.92); }
.round svg { width: 27px; height: 27px; }
.round small { position: absolute; top: 100%; margin-top: 6px; font-size: 12px; white-space: nowrap; opacity: .85; left: 50%; transform: translateX(-50%); }
.call-controls .round { margin-bottom: 20px; }
.round.sm { width: 40px; height: 40px; } .round.sm svg { width: 22px; height: 22px; }
.round.xs { width: 34px; height: 34px; } .round.xs svg { width: 18px; height: 18px; }
.round.off { background: #fff; color: #222; }
.round.green { background: var(--green); }
.round.red { background: var(--red); }

/* свёрнутый звонок: маленькое окно поверх переписки, его можно таскать */
.mini-bar { display: none; }
.call.mini { inset: auto; left: 0; top: 0; width: 220px; height: auto; border-radius: 16px; box-shadow: 0 10px 34px rgba(0, 0, 0, .4); cursor: grab; will-change: transform; }
.call.mini .call-top, .call.mini .call-controls, .call.mini #tileSelf { display: none !important; }
.call.mini #tileRemote { position: relative; inset: auto; width: 100%; aspect-ratio: 4 / 3; transform: none !important; border-radius: 0; box-shadow: none; z-index: 1; cursor: inherit; }
.call.mini #tileRemote:not(.has-video) { aspect-ratio: 16 / 9; }
.call.mini .avatar.xl { width: 56px; height: 56px; font-size: 22px; }
.call.mini .mini-bar { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 12px; background: #1c2733; }
.mini-text { flex: 1; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }

/* ---------- диалоги ---------- */
.dialog { border: 0; border-radius: 14px; padding: 18px; width: min(92vw, 420px); background: var(--panel); color: var(--text); box-shadow: 0 10px 40px rgba(0, 0, 0, .3); }
.dialog::backdrop { background: rgba(0, 0, 0, .4); }
.dialog h2 { margin: 0 0 10px; font-size: 18px; font-weight: 600; }
.dialog h2:empty { display: none; }
.dialog label { display: block; font-size: 13px; color: var(--accent); margin: 12px 0 4px; font-weight: 500; }
input { width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--input); color: var(--text); font: inherit; font-size: 16px; outline: none; }
input:focus { border-color: var(--accent); }
.dialog .link { word-break: break-all; background: var(--input); padding: 10px 12px; border-radius: 10px; font-size: 14px; user-select: all; }
.code { font-size: 34px; font-weight: 600; letter-spacing: 6px; text-align: center; padding: 8px 0; user-select: all; font-variant-numeric: tabular-nums; }
.dialog p { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.dialog .profile { text-align: center; margin-bottom: 6px; }
.dialog .profile .avatar { margin: 0 auto 8px; width: 80px; height: 80px; font-size: 30px; }
.dialog-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.dialog-actions button { padding: 9px 14px; border-radius: 10px; font-weight: 600; color: var(--accent); }
.dialog-actions button:hover { background: var(--hover); }
.dialog-actions button:active { transform: scale(.96); }
.dialog-actions .primary { background: var(--accent); color: #fff; }
.dialog-actions .primary:hover { background: var(--accent); filter: brightness(1.05); }

.viewer { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .94); display: grid; place-items: center; cursor: zoom-out; }
.viewer img { max-width: 100%; max-height: 100%; }
.toast { position: fixed; left: 50%; bottom: calc(var(--safe-bottom) + 84px); transform: translateX(-50%); background: rgba(30, 30, 30, .92); color: #fff; padding: 10px 16px; border-radius: 12px; z-index: 70; font-size: 15px; max-width: 90vw; text-align: center; }

/* ---------- служебные экраны ---------- */
.cover { position: fixed; inset: 0; z-index: 20; background: var(--bg); overflow-y: auto; }
.notice { padding: 48px 24px; text-align: center; display: flex; flex-direction: column; justify-content: center; }
.notice > * { max-width: 420px; width: 100%; margin-left: auto; margin-right: auto; }
.notice .logo { width: 88px; height: 88px; margin-bottom: 8px; display: block; }
.notice h1 { font-size: 26px; font-weight: 600; margin: 10px auto; letter-spacing: -.02em; line-height: 1.15; }
.notice p { color: var(--muted); }
.notice .hint { font-size: 14px; }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.pill { background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 15px; }
.pill:active { transform: scale(.97); }
.pill.big { padding: 13px 16px; font-size: 16px; width: 100%; }
body.plain .notice { min-height: 100dvh; }
body.plain form { margin: 18px 0 8px; }

/* ---------- управление: вкладки, плитки, графики ---------- */
.seg-wrap { padding: 8px 12px; background: var(--side-bg); border-bottom: .5px solid var(--line); }
.seg { display: flex; background: var(--input); border-radius: 9px; padding: 2px; }
.seg button { flex: 1; padding: 6px 8px; border-radius: 7px; font-size: 14px; font-weight: 500; color: var(--text); }
.seg button.on { background: var(--side-bg); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.seg.small { display: inline-flex; }
.seg.small button { flex: none; padding: 4px 10px; font-size: 13px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; padding: 0 12px; }
.tile-stat { background: var(--side-bg); border-radius: 12px; padding: 12px 14px; }
.tile-stat .t-label { font-size: 13px; color: var(--muted); }
.tile-stat .t-value { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tile-stat .t-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.chart { background: var(--side-bg); border-radius: 12px; margin: 0 12px; padding: 12px 14px 8px; position: relative; }
.chart h3 { margin: 0 0 2px; font-size: 15px; font-weight: 600; }
.chart .c-sum { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.chart svg { width: 100%; height: 140px; display: block; overflow: visible; }
.chart .bar { fill: var(--accent); }
.chart .bar-hit { fill: transparent; cursor: default; }
.chart .bar-hit:hover + .bar, .chart .bar.hl { fill: color-mix(in srgb, var(--accent) 70%, var(--text)); }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .tip { position: absolute; pointer-events: none; background: var(--text); color: var(--side-bg); font-size: 12px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -100%); }
.stats-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 8px; }
.stats-head .group-title { padding: 0; }
.utable { width: 100%; border-collapse: collapse; background: var(--side-bg); font-size: 14px; }
.utable th { text-align: right; font-weight: 500; color: var(--muted); font-size: 12px; padding: 8px 8px; border-bottom: .5px solid var(--line); white-space: nowrap; cursor: pointer; user-select: none; }
.utable th:first-child, .utable td:first-child { text-align: left; padding-left: 14px; }
.utable th.sorted { color: var(--accent); }
.utable td { text-align: right; padding: 9px 8px; border-bottom: .5px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
.utable td:first-child { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.utable tr { cursor: pointer; }
.utable tr:hover td { background: var(--hover); }
.utable .u-sub { display: block; font-size: 12px; color: var(--muted); }
.table-scroll { overflow-x: auto; margin: 0 0 4px; }
.warn { color: #c77700; font-weight: 500; }
.banned-row { opacity: .5; }
.dialog .facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; margin: 6px 0 10px; }
.dialog .facts dt { color: var(--muted); }
.dialog .facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.dialog .check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--text); margin: 8px 0 0; }
.dialog .check input { width: auto; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--input); transition: background .2s; }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(18px); }
.banner .close { width: 32px; height: 32px; color: var(--muted); margin-right: -4px; }
.banner .close svg { width: 18px; height: 18px; }
