/* Pont Instagram ⇄ Telegram — admin. Light/dark, widget grid, Telegram-like conversation. No inline styles (CSP). */
:root {
  --bg: #f1f2f8; --bg-2: #e9ebf5; --card: #ffffff; --card-2: #f7f8fc; --ink: #141625; --ink-2: #3b3f55; --muted: #7a7f96;
  --line: #e6e8f1; --line-2: #d8dbe8;
  --accent: #6d5efc; --accent-2: #8f5cf6; --accent-soft: #eeecff; --accent-ink: #fff;
  --grad: linear-gradient(135deg, #6d5efc 0%, #a855f7 55%, #ec4899 100%);
  --ok: #12a46f; --ok-soft: #e2f6ee; --warn: #d98a00; --warn-soft: #fff3db; --bad: #e5484d; --bad-soft: #fde8e8; --info: #3b82f6; --info-soft: #e6effe;
  --elle: #ec4899; --toi-app: #8b5cf6; --toi-tg: #2aabee;
  --t-violet: #7c3aed; --t-violet-bg: #f1eaff; --t-pink: #db2777; --t-pink-bg: #fde7f2; --t-blue: #2563eb; --t-blue-bg: #e5eeff;
  --t-green: #059669; --t-green-bg: #defaf0; --t-amber: #d97706; --t-amber-bg: #fff2d9; --t-red: #dc2626; --t-red-bg: #fde6e6; --t-slate: #475569; --t-slate-bg: #edf0f5;
  --r: 22px; --r-s: 14px;
  --shadow: 0 1px 2px rgba(20, 22, 37, .04), 0 10px 30px -12px rgba(20, 22, 37, .12);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --tg-bg: #a8c68f; --tg-bg-2: #d7e4b7; --tg-in: #ffffff; --tg-out: #e3fcc8; --tg-ink: #0f1419; --tg-meta: #7c8a7a; --tg-meta-out: #5ea94a;
  --tg-service: rgba(66, 90, 50, .38);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d0f17; --bg-2: #131624; --card: #171a28; --card-2: #1d2131; --ink: #eceef6; --ink-2: #c3c7d8; --muted: #8b90a7;
  --line: #262a3c; --line-2: #31364b;
  --accent: #8b7dff; --accent-2: #a78bfa; --accent-soft: #24213f; --accent-ink: #0d0f17;
  --ok: #34d399; --ok-soft: #10291f; --warn: #fbbf24; --warn-soft: #2d2412; --bad: #f87171; --bad-soft: #321718; --info: #60a5fa; --info-soft: #14223a;
  --t-violet: #a78bfa; --t-violet-bg: #251d40; --t-pink: #f472b6; --t-pink-bg: #351a2b; --t-blue: #60a5fa; --t-blue-bg: #16243d;
  --t-green: #34d399; --t-green-bg: #12291f; --t-amber: #fbbf24; --t-amber-bg: #2e2412; --t-red: #f87171; --t-red-bg: #331819; --t-slate: #a3b0c5; --t-slate-bg: #1f2534;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 30px -14px rgba(0, 0, 0, .6);
  --tg-bg: #0e1621; --tg-bg-2: #17212b; --tg-in: #182533; --tg-out: #2b5278; --tg-ink: #f5f5f5; --tg-meta: #6d7f8f; --tg-meta-out: #7da8d3;
  --tg-service: rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14.5px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
code { font-family: var(--mono); font-size: 12.5px; background: var(--card-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .hidden { display: none !important; } .grow { flex: 1; min-width: 0; }
.bad-text { color: var(--bad); }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.ic { width: 18px; height: 18px; flex: none; }
.stack > * + * { margin-top: 12px; }
.stack.center { text-align: center; } .stack.center .row { justify-content: center; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }

/* ---------------------------------------------------------------- buttons, inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; transition: transform .08s, background .15s, box-shadow .15s; }
.btn:hover { background: var(--card-2); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 18px -6px rgba(109, 94, 252, .55); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--card-2); }
.btn.small { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 10px; }
.btn.big { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 14px; }
.btn:disabled, .icon-btn:disabled, button:disabled { opacity: .55; cursor: default; }
.btn.is-busy, .icon-btn.is-busy, .glass.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after, .icon-btn.is-busy::after, .glass.is-busy::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid var(--muted); border-right-color: transparent; border-radius: 50%; animation: rot .7s linear infinite; }
.btn.primary.is-busy::after, .glass.is-busy::after { border-color: #fff; border-right-color: transparent; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--card-2); color: var(--ink); text-decoration: none; }
.icon-btn.danger { color: var(--bad); }
.icon-btn.spinning .ic { animation: rot .8s linear infinite; }
.link-btn { background: none; border: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 0 4px; }
input, select, textarea { width: 100%; height: 42px; padding: 0 13px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--card); color: var(--ink); font: inherit; transition: border-color .15s, box-shadow .15s; }
input[type=file] { padding: 8px 10px; height: auto; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.code-input { text-align: center; letter-spacing: .4em; font-size: 20px; font-weight: 700; height: 52px; }
.field { display: block; }
.field > span { display: block; font-weight: 600; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.input-row { display: flex; gap: 8px; }
.input-row > input { flex: 1; min-width: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.switch-row { position: relative; display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; margin-bottom: 14px; }
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { width: 44px; height: 26px; border-radius: 99px; background: var(--line-2); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch-row input:checked + .switch { background: var(--accent); }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
.switch-row input:focus-visible + .switch { box-shadow: 0 0 0 4px var(--accent-soft); }

/* ---------------------------------------------------------------- pills & dots */
.pill { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font-size: 12.5px; font-weight: 650; color: var(--ink-2); white-space: nowrap; }
.pill.ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.pill.warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.pill.bad { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
.pill.info { color: var(--info); background: var(--info-soft); border-color: transparent; }
.pill.live.on { color: var(--ok); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; color: var(--muted); }
.dot.ok { background: var(--ok); color: var(--ok); } .dot.warn { background: var(--warn); color: var(--warn); }
.dot.bad { background: var(--bad); color: var(--bad); } .dot.info { background: var(--info); color: var(--info); }
.dot.pulse { animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70%, 100% { box-shadow: 0 0 0 6px transparent; } }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- shell */
.shell { display: flex; min-height: 100vh; }
.rail { width: 88px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 10px; background: var(--card); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; z-index: 10; }
.rail-logo { margin-bottom: 14px; }
.rail-logo img { width: 42px; height: 42px; border-radius: 13px; box-shadow: 0 6px 16px -6px rgba(109, 94, 252, .6); display: block; }
.nav { position: relative; width: 68px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 4px; border-radius: 16px; color: var(--muted); font-size: 11px; font-weight: 650; text-decoration: none !important; transition: background .15s, color .15s; }
.nav:hover { color: var(--ink); background: var(--card-2); }
.nav-ic { display: grid; place-items: center; width: 40px; height: 32px; border-radius: 11px; }
.nav.active { color: var(--accent); }
.nav.active .nav-ic { background: var(--accent-soft); }
.nav .ic { width: 20px; height: 20px; }
.nav-dot { position: absolute; top: 8px; right: 14px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--card); }
.nav-dot.bad { background: var(--bad); } .nav-dot.warn { background: var(--warn); }
.page { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 22px 32px 6px; }
.page-title { font-size: 28px; font-weight: 750; letter-spacing: -.025em; }
.avatar-btn { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.avatar-btn:hover { color: var(--bad); }
.content { padding: 18px 32px 48px; width: 100%; max-width: 1360px; }
.content.full { padding-bottom: 20px; }
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .rail { position: fixed; bottom: 0; top: auto; left: 0; right: 0; width: 100%; height: auto; flex-direction: row; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); gap: 0; }
  .rail-logo { display: none; }
  .nav { width: auto; flex: 1; padding: 4px 2px; font-size: 10px; }
  .nav-dot { right: calc(50% - 18px); }
  .topbar { padding: 16px 16px 4px; flex-wrap: wrap; }
  .page-title { font-size: 23px; }
  .topbar .grow { min-width: 10px; }
  .content { padding: 12px 14px 96px; }
}

/* ---------------------------------------------------------------- widget grid */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; align-items: start; }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
@media (max-width: 1150px) { .span-3, .span-4, .span-5 { grid-column: span 6; } .span-7, .span-8 { grid-column: span 12; } }
@media (max-width: 720px) { .grid { gap: 14px; } .span-3, .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; } }
.w { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 20px 20px; min-width: 0; }
.view.entering .w, .view.entering .setup-step, .view.entering .chat { animation: rise .35s ease-out both; }
.view-accueil .w, .view-reglages .w { align-self: stretch; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.w-head { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; min-height: 34px; flex-wrap: wrap; }
.w-head h2 { font-size: 15px; font-weight: 700; flex: 1; letter-spacing: -.01em; }
.w-head .row { flex-wrap: wrap; justify-content: flex-end; }
.w-head input[type=search] { height: 34px; width: 160px; }
.chip { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; flex: none; }
.chip .ic { width: 18px; height: 18px; }
.tone-violet { --tone: var(--t-violet); --tone-bg: var(--t-violet-bg); } .tone-pink { --tone: var(--t-pink); --tone-bg: var(--t-pink-bg); }
.tone-blue { --tone: var(--t-blue); --tone-bg: var(--t-blue-bg); } .tone-green { --tone: var(--t-green); --tone-bg: var(--t-green-bg); }
.tone-amber { --tone: var(--t-amber); --tone-bg: var(--t-amber-bg); } .tone-red { --tone: var(--t-red); --tone-bg: var(--t-red-bg); }
.tone-slate { --tone: var(--t-slate); --tone-bg: var(--t-slate-bg); }
.chip[class*="tone-"] { color: var(--tone); background: var(--tone-bg); }
.w-note { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.w-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 650; font-size: 13px; }
.w-link .ic { width: 15px; height: 15px; }
.w-foot { margin-top: 14px; color: var(--muted); font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; align-items: center; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); padding: 28px 0; text-align: center; }
.empty .ic { width: 28px; height: 28px; opacity: .6; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.kv span { color: var(--muted); }
.kv b { overflow-wrap: anywhere; text-align: right; }
.banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 16px; font-size: 14px; }
.banner > b, .banner > span { flex: 1; }
.banner.bad { background: var(--bad-soft); color: var(--bad); } .banner.warn { background: var(--warn-soft); color: var(--warn); } .banner.ok { background: var(--ok-soft); color: var(--ok); }
.banner .btn { color: var(--ink); }
.hint { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--card-2); color: var(--ink-2); font-size: 13px; }
.hint .ic { color: var(--accent); margin-top: 2px; }
.promo { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 16px; background: var(--accent-soft); color: var(--ink-2); margin-bottom: 14px; }
.promo .ic { width: 30px; height: 30px; color: var(--accent); }

/* ---------------------------------------------------------------- home */
.hero { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; min-height: 172px; color: #fff; border: 0; background: var(--grad); padding: 26px 28px; }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .12); pointer-events: none; }
.hero::before { width: 260px; height: 260px; right: -60px; top: -110px; }
.hero::after { width: 160px; height: 160px; right: 140px; bottom: -100px; }
.hero.tone-warn { background: linear-gradient(135deg, #f59e0b, #f97316 60%, #ef4444); }
.hero.tone-bad { background: linear-gradient(135deg, #ef4444, #db2777); }
.hero-main { display: flex; align-items: center; gap: 18px; position: relative; z-index: 1; min-width: 0; }
.hero-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: rgba(255, 255, 255, .2); color: #fff; backdrop-filter: blur(6px); flex: none; }
.hero-icon .ic { width: 30px; height: 30px; }
.hero-title { font-size: 27px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.hero-sub { opacity: .9; margin-top: 4px; font-size: 14px; }
.hero-actions { display: flex; gap: 8px; position: relative; z-index: 1; }
.glass { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 15px; border-radius: 13px; border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .16); color: #fff; font: inherit; font-weight: 650; cursor: pointer; backdrop-filter: blur(6px); }
.glass:hover { background: rgba(255, 255, 255, .26); }
.import .w-body { display: flex; align-items: center; gap: 18px; }
.ring { position: relative; display: inline-grid; place-items: center; }
.ring svg { display: block; }
.ring-bg { fill: none; stroke: var(--card-2); stroke-width: 11; }
.ring-fg { fill: none; stroke: var(--tone, var(--accent)); stroke-width: 11; stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.ring.tone-blue { --tone: #3b82f6; } .ring.tone-violet { --tone: #8b5cf6; } .ring.tone-red { --tone: #ef4444; }
.ring-c { position: absolute; inset: 0; display: grid; place-items: center; }
.ring-c b { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.rm-main { font-size: 19px; font-weight: 750; }
.rm-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.big { font-size: 46px; font-weight: 800; letter-spacing: -.04em; line-height: 1; margin: 2px 0 12px; }
.split { display: flex; gap: 14px; color: var(--ink-2); font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.split span, .legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 4px; display: inline-block; }
.preview { display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 360px; overflow: hidden; padding: 12px 16px; border-radius: 16px; background: var(--tg-bg-2); -webkit-mask-image: linear-gradient(transparent 0, #000 70px); mask-image: linear-gradient(transparent 0, #000 70px); }
.preview .bubble { max-width: 85%; }
.svc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.svc { display: flex; align-items: center; gap: 11px; padding: 12px; border-radius: 16px; background: var(--card-2); min-width: 0; position: relative; }
.svc > div { display: flex; flex-direction: column; min-width: 0; }
.svc b { font-size: 13px; }
.svc > div span { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--card); color: var(--ink-2); flex: none; }
.svc.ok .svc-ic { color: var(--ok); } .svc.warn .svc-ic { color: var(--warn); } .svc.bad .svc-ic { color: var(--bad); } .svc.info .svc-ic { color: var(--info); }
.svc > i.dot { position: absolute; top: 10px; right: 10px; width: 7px; height: 7px; }
.chart-box { min-height: 170px; }

/* ---------------------------------------------------------------- charts */
.bwrap { width: 100%; }
.bchart { position: relative; }
.bgrid { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.bgrid i { display: block; border-top: 1px dashed var(--line); }
.bcols { position: relative; height: 100%; display: flex; align-items: flex-end; gap: clamp(2px, .7%, 8px); }
.bcol { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 0; }
.bstack { width: 100%; display: flex; flex-direction: column-reverse; border-radius: 7px 7px 3px 3px; overflow: hidden; min-height: 3px; transition: height .4s ease; }
.bstack.zero { background: var(--line); height: 3px !important; border-radius: 2px; }
.bseg { flex-basis: 0; min-height: 2px; }
.bcol:hover .bstack { filter: brightness(1.08); }
.baxis { display: flex; gap: clamp(2px, .7%, 8px); margin-top: 8px; }
.baxis span { flex: 1; min-width: 0; font-size: 11px; color: var(--muted); text-align: center; white-space: nowrap; overflow: visible; }
.fill-elle { fill: var(--elle); background: var(--elle); stroke: var(--elle); }
.fill-toi_app { fill: var(--toi-app); background: var(--toi-app); stroke: var(--toi-app); }
.fill-toi_tg { fill: var(--toi-tg); background: var(--toi-tg); stroke: var(--toi-tg); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 10px; }
.spark { width: 100%; height: 44px; display: block; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark-area { fill: var(--accent-soft); stroke: none; }
.donut-row { display: flex; align-items: center; gap: 18px; }
.donut-wrap { position: relative; width: 136px; height: 136px; flex: none; }
.donut { width: 100%; height: 100%; }
.donut-seg { fill: none; stroke-width: 16; }
.donut .ring-bg { stroke-width: 16; }
.donut-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-c b { font-size: 22px; font-weight: 800; }
.donut-c span { font-size: 11px; color: var(--muted); }
.donut-legend { display: flex; flex-direction: column; gap: 8px; font-size: 13px; flex: 1; min-width: 0; }
.donut-legend div { display: flex; align-items: center; gap: 8px; }
.donut-legend span { flex: 1; color: var(--ink-2); }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hb { display: grid; grid-template-columns: 110px 1fr 54px; align-items: center; gap: 10px; font-size: 13px; }
.hb-l { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-track { height: 10px; background: var(--card-2); border-radius: 99px; overflow: hidden; }
.hb-fill { height: 100%; background: var(--grad); border-radius: 99px; }
.hb b { text-align: right; }
.hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 4px; }
.hours div { aspect-ratio: 1; border-radius: 6px; background: var(--accent); }
.hours-labels { display: grid; grid-template-columns: repeat(24, 1fr); font-size: 10.5px; color: var(--muted); margin-top: 6px; }
.stats-row { display: flex; gap: 26px; flex-wrap: wrap; }
.stat-v { font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat-l { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { height: 32px; padding: 0 13px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2); font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; }
.chip-btn.on { background: var(--ink); border-color: var(--ink); color: var(--card); }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- settings */
.person { display: flex; align-items: center; gap: 14px; }
.person > div:last-child { display: flex; flex-direction: column; min-width: 0; }
.person b { font-size: 17px; }
.avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 800; flex: none; }
.avatar.big { width: 52px; height: 52px; font-size: 20px; }
.setup { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.setup-head { display: flex; align-items: center; gap: 16px; padding: 24px; border-radius: var(--r); background: var(--grad); color: #fff; }
.setup-head h2 { font-size: 26px; font-weight: 800; }
.setup-head .muted { color: rgba(255, 255, 255, .85); }
.setup-step { display: flex; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.setup-step > .stack { flex: 1; min-width: 0; }
.setup-step h3 { font-size: 16px; }
.setup-n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-weight: 800; flex: none; }
.steps-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* ---------------------------------------------------------------- system & security */
.health-score { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.health-score b { font-size: 30px; font-weight: 800; }
.health-score span { color: var(--muted); font-weight: 600; }
.check-group { padding: 10px 0; border-top: 1px solid var(--line); }
.cg-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 4px 0; font-size: 13.5px; }
.check-ic { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 7px; flex: none; margin-top: 1px; }
.check-ic .ic { width: 13px; height: 13px; stroke-width: 2.6; }
.check.ok .check-ic { background: var(--ok-soft); color: var(--ok); } .check.warn .check-ic { background: var(--warn-soft); color: var(--warn); }
.check.bad .check-ic { background: var(--bad-soft); color: var(--bad); } .check.info .check-ic { background: var(--info-soft); color: var(--info); }
.rings { display: flex; gap: 22px; justify-content: space-around; margin-bottom: 10px; }
.rings > div { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; text-align: center; }
.rings .ring-c b { font-size: 18px; }
.term { background: #0b0d14; color: #c8ccd8; border-radius: 16px; padding: 14px 16px; font: 12px/1.65 var(--mono); height: 420px; overflow: auto; }
.term div { white-space: pre-wrap; overflow-wrap: anywhere; }
.term .l-err { color: #ff8a80; } .term .l-warn { color: #ffcf6b; } .term .l-ok { color: #6ee7a8; } .term .l-admin { color: #a5a6ff; }
.bk-list, .rows { display: flex; flex-direction: column; margin-top: 12px; }
.bk, .row-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.row-item > div.grow { display: flex; flex-direction: column; }
.bk-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.bk-main span { color: var(--muted); font-size: 12.5px; }
.bk-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--t-slate-bg); color: var(--t-slate); flex: none; }
.bk-ic.full { background: var(--t-blue-bg); color: var(--t-blue); }
.audit { display: flex; flex-direction: column; max-height: 420px; overflow: auto; }
.audit-row { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.audit-row.ko .audit-ev { color: var(--bad); }
@media (max-width: 640px) { .audit-row { grid-template-columns: 10px 1fr; } .audit-row code, .audit-row .small { grid-column: 2; } }
.qr { width: 220px; height: 220px; border-radius: 16px; background: #fff; padding: 8px; margin: 0 auto; display: block; }

/* ---------------------------------------------------------------- modals, toasts, lightbox */
.backdrop { position: fixed; inset: 0; background: rgba(10, 12, 22, .45); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--card); border-radius: 24px; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); animation: pop .18s ease-out; }
.modal.wide { max-width: 1100px; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 6px; }
.modal-head h2 { flex: 1; font-size: 18px; font-weight: 750; }
.modal-head .icon-btn { border: 0; }
.modal-body { padding: 10px 20px 22px; }
.modal-body > * + * { margin-top: 12px; }
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: min(400px, calc(100vw - 36px)); }
@media (max-width: 860px) { #toasts { bottom: 86px; } }
.toast { display: flex; align-items: center; gap: 10px; background: var(--ink); color: var(--card); border-radius: 14px; padding: 11px 16px; font-weight: 600; font-size: 13.5px; box-shadow: 0 14px 34px rgba(0, 0, 0, .25); animation: rise .2s ease-out; transition: opacity .3s, transform .3s; }
.toast.out { opacity: 0; transform: translateY(6px); }
.lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .88); display: grid; place-items: center; padding: 20px; cursor: zoom-out; animation: fade .15s; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }
.vnc { background: #000; border-radius: 16px; overflow: hidden; height: 66vh; min-height: 380px; }
.vnc > div { width: 100%; height: 100%; }

/* ---------------------------------------------------------------- login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(900px 500px at 15% 10%, rgba(109, 94, 252, .18), transparent 60%), radial-gradient(700px 500px at 90% 90%, rgba(236, 72, 153, .14), transparent 60%), var(--bg); }
.login { width: 100%; max-width: 380px; background: var(--card); border-radius: 28px; padding: 34px 30px; box-shadow: var(--shadow), 0 30px 70px -30px rgba(109, 94, 252, .35); display: flex; flex-direction: column; gap: 12px; text-align: center; }
.login-logo img { width: 64px; height: 64px; border-radius: 20px; box-shadow: 0 12px 26px -10px rgba(109, 94, 252, .7); }
.login h1 { font-size: 28px; font-weight: 800; letter-spacing: -.03em; margin-top: 6px; }
.login .muted { margin-bottom: 10px; }
.login .btn { width: 100%; margin-top: 6px; }
.login .banner { text-align: left; }

/* ---------------------------------------------------------------- Telegram-like conversation */
.chat { position: relative; display: flex; flex-direction: column; height: calc(100vh - 118px); min-height: 480px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--tg-bg); }
@media (max-width: 860px) { .chat { height: calc(100vh - 186px); border-radius: 18px; } }
.chat::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .22) 0 2px, transparent 3px), radial-gradient(circle at 70% 60%, rgba(255, 255, 255, .16) 0 1.5px, transparent 2.5px), linear-gradient(160deg, var(--tg-bg-2), var(--tg-bg));
  background-size: 46px 46px, 34px 34px, 100% 100%; }
.chat-head { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.chat-title { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.chat-title b { font-size: 15.5px; }
.chat-sub { color: var(--muted); font-size: 12.5px; }
.chat-search { display: flex; align-items: center; gap: 8px; background: var(--card-2); border-radius: 12px; padding: 0 12px; width: min(320px, 45%); color: var(--muted); }
.chat-search input { border: 0; background: transparent; height: 38px; padding: 0; box-shadow: none !important; }
.chat-banner { position: relative; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--card); border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.chat-scroll { position: relative; z-index: 1; flex: 1; overflow-y: auto; padding: 14px 6% 18px; }
@media (max-width: 860px) { .chat-scroll { padding: 10px 10px 14px; } .chat-search { width: auto; flex: 1; } .chat-title { display: none; } }
.chat-list { display: flex; flex-direction: column; max-width: 860px; margin: 0 auto; }
.chat-foot { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; background: var(--card); border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.chat-foot .ic { color: var(--toi-tg); }
.chat-empty, .chat-start { align-self: center; margin: 30px 0; display: flex; flex-direction: column; align-items: center; gap: 8px; background: var(--tg-service); color: #fff; padding: 10px 16px; border-radius: 14px; font-size: 13px; font-weight: 600; }
.chat-start { margin: 6px 0 14px; padding: 5px 12px; }
.chat-fab { position: absolute; right: 22px; bottom: 62px; z-index: 3; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--card); color: var(--ink-2); box-shadow: 0 6px 18px rgba(0, 0, 0, .2); display: grid; place-items: center; cursor: pointer; }
.fab-n:empty { display: none; }
.fab-n { position: absolute; top: -6px; right: -4px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--toi-tg); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.day-group { display: flex; flex-direction: column; }
.day { position: sticky; top: 4px; z-index: 2; align-self: center; margin: 10px 0 8px; }
.day span { display: inline-block; padding: 4px 11px; border-radius: 99px; background: var(--tg-service); color: #fff; font-size: 12.5px; font-weight: 650; backdrop-filter: blur(6px); }
.service { align-self: center; margin: 6px 0; }
.service span { display: inline-block; padding: 4px 12px; border-radius: 99px; background: var(--tg-service); color: #fff; font-size: 12.5px; font-weight: 600; }
.msg { display: flex; margin-top: 7px; }
.msg.compact { margin-top: 2px; }
.msg.in { justify-content: flex-start; }
.msg.out { justify-content: flex-end; }
.bubble { position: relative; max-width: min(520px, 78%); padding: 6px 10px; border-radius: 16px; background: var(--tg-in); color: var(--tg-ink); box-shadow: 0 1px 1px rgba(0, 0, 0, .13); font-size: 14.5px; line-height: 1.4; overflow-wrap: anywhere; }
.msg.out .bubble { background: var(--tg-out); }
.msg.in.tail .bubble { border-bottom-left-radius: 5px; }
.msg.out.tail .bubble { border-bottom-right-radius: 5px; }
.msg.in.tail .bubble::before, .msg.out.tail .bubble::before { content: ""; position: absolute; bottom: 0; width: 12px; height: 14px; background: inherit; }
.msg.in.tail .bubble::before { left: -7px; clip-path: path("M12 0 C12 8 9 12 0 14 L12 14 Z"); }
.msg.out.tail .bubble::before { right: -7px; clip-path: path("M0 0 C0 8 3 12 12 14 L0 14 Z"); }
.bubble.bare { background: transparent !important; box-shadow: none; padding: 0; }
.bubble.bare::before { display: none; }
.bubble.bare .meta { background: var(--tg-service); color: #fff !important; padding: 3px 7px; border-radius: 99px; }
.txt { white-space: pre-wrap; display: inline; }
.txt a { color: #168acd; text-decoration: underline; }
.meta { float: right; display: inline-flex; align-items: center; gap: 3px; margin: 7px 0 -3px 12px; font-size: 11.5px; color: var(--tg-meta); line-height: 1; user-select: none; }
.msg.out .meta { color: var(--tg-meta-out); }
.meta .ic { width: 13px; height: 13px; }
.meta .ticks .ic { stroke-width: 2.6; }
.origin { opacity: .8; display: inline-flex; }
.quote { display: flex; flex-direction: column; border-left: 3px solid var(--elle); background: rgba(236, 72, 153, .09); border-radius: 6px; padding: 3px 9px 4px; margin: 2px 0 5px; font-size: 13px; min-width: 0; }
.quote.q-moi { border-left-color: #4fae4e; background: rgba(79, 174, 78, .12); }
.quote b { color: var(--elle); font-size: 13px; }
.quote.q-moi b { color: #3d9a3c; }
.quote span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--tg-ink); opacity: .8; }
.media { display: block; max-width: 100%; width: 320px; max-height: 380px; object-fit: cover; border-radius: 12px; margin: 2px -4px 4px; cursor: zoom-in; background: rgba(0, 0, 0, .06); }
video.media { cursor: default; }
.sticker-img { display: block; width: 150px; height: 150px; object-fit: contain; }
.media-gone { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin: 2px 0 4px; border-radius: 12px; background: rgba(0, 0, 0, .06); color: var(--tg-meta); font-size: 13px; font-style: italic; }
.deleted { color: var(--tg-meta); font-style: italic; display: inline; }
.linkcard { display: flex; gap: 10px; align-items: center; padding: 8px 10px; margin: 2px 0 4px; border-radius: 10px; background: rgba(22, 138, 205, .09); border-left: 3px solid #168acd; color: var(--tg-ink); text-decoration: none !important; }
.linkcard div { display: flex; flex-direction: column; min-width: 0; }
.linkcard b { font-size: 13.5px; }
.linkcard span { font-size: 12px; color: #168acd; }
.linkcard .ic { color: #168acd; }
.vp { display: flex; align-items: center; gap: 10px; min-width: 230px; padding: 3px 0; }
.vp-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; background: #3a9eda; color: #fff; cursor: pointer; flex: none; }
.vp-btn.moi { background: #59b25a; }
.vp-btn .ic { width: 16px; height: 16px; }
.vp-bar { flex: 1; height: 22px; position: relative; cursor: pointer; background: repeating-linear-gradient(90deg, rgba(58, 158, 218, .35) 0 2px, transparent 2px 5px); }
.msg.out .vp-bar { background: repeating-linear-gradient(90deg, rgba(89, 178, 90, .45) 0 2px, transparent 2px 5px); }
.vp-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: repeating-linear-gradient(90deg, #3a9eda 0 2px, transparent 2px 5px); }
.msg.out .vp-fill { background: repeating-linear-gradient(90deg, #4c9d4d 0 2px, transparent 2px 5px); }
.vp-time { font-size: 12px; color: var(--tg-meta); min-width: 34px; }
.transcript { display: flex; gap: 6px; margin: 4px 0 2px; padding: 6px 9px; border-radius: 10px; background: rgba(0, 0, 0, .05); font-size: 13.5px; font-style: italic; color: var(--tg-ink); }
.transcript .ic { width: 14px; height: 14px; margin-top: 2px; opacity: .6; }
.reacts { clear: both; display: flex; flex-wrap: wrap; gap: 4px; padding-top: 5px; }
.react { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 7px; border-radius: 99px; background: rgba(58, 158, 218, .14); font-size: 14px; }
.msg.out .react { background: rgba(79, 174, 78, .18); }
.react i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-style: normal; font-size: 10px; font-weight: 800; color: #fff; background: var(--elle); }
.react.r-moi i { background: #4fae4e; }
:root[data-theme="dark"] .media-gone, :root[data-theme="dark"] .transcript { background: rgba(255, 255, 255, .06); }
:root[data-theme="dark"] .txt a, :root[data-theme="dark"] .linkcard span, :root[data-theme="dark"] .linkcard .ic { color: #6ab3f3; }
:root[data-theme="dark"] .vp-btn, :root[data-theme="dark"] .vp-btn.moi { background: #6ab3f3; }
:root[data-theme="dark"] .quote.q-moi b { color: #8fd18e; }
:root[data-theme="dark"] .msg.out .vp-fill, :root[data-theme="dark"] .vp-fill { background: repeating-linear-gradient(90deg, #6ab3f3 0 2px, transparent 2px 5px); }
:root[data-theme="dark"] .chat::before { background-image: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .05) 0 2px, transparent 3px), radial-gradient(circle at 70% 60%, rgba(255, 255, 255, .035) 0 1.5px, transparent 2.5px), linear-gradient(160deg, var(--tg-bg-2), var(--tg-bg)); }

/* ---------------------------------------------------------------- theme switch */
.theme-switch { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.theme-switch button { display: grid; place-items: center; width: 32px; height: 30px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; }
.theme-switch button:hover { color: var(--ink); }
.theme-switch button.on { background: var(--accent-soft); color: var(--accent); }
.theme-switch .ic { width: 16px; height: 16px; }
