/* Палитра — из старого theme.py, чтобы сайт остался узнаваемым */
:root {
  --bg: #0a0c0f; --panel: #111318; --panel2: #181b22;
  --border: rgba(255,255,255,.07); --border-hi: rgba(255,255,255,.12);
  --accent: #4f8ef7; --accent-hover: #3a7de8; --accent-glow: rgba(79,142,247,.35);
  --green: #22c55e; --green-bg: rgba(34,197,94,.12);
  --yellow: #f59e0b; --yellow-bg: rgba(245,158,11,.12);
  --red: #ef4444; --red-bg: rgba(239,68,68,.12);
  --text: #e8eaf0; --dim: #8a909c;
  --r: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.55;
  font: 15px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; margin: 0; }
h2 { font-size: 18px; margin: 40px 0 14px; }
h3 { font-size: 16px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.dim { color: var(--dim); }
.small { font-size: 13px; }

.top { border-bottom: 1px solid var(--border); background: rgba(10,12,15,.85); position: sticky; top: 0; backdrop-filter: blur(8px); z-index: 5; }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { color: var(--text); font-weight: 650; letter-spacing: .02em; }
.brand-mark { color: var(--accent); }
nav { display: flex; align-items: center; gap: 18px; }
nav a { color: var(--dim); font-size: 14px; }
nav a[aria-current="page"], nav a:hover { color: var(--text); text-decoration: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border: 0;
  background: var(--accent); color: #fff !important; font: inherit; font-weight: 600; border-radius: 8px; cursor: pointer;
  transition: background .15s, box-shadow .15s; text-decoration: none !important; }
.btn:hover { background: var(--accent-hover); box-shadow: 0 0 24px var(--accent-glow); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-ghost { background: transparent; border: 1px solid var(--border-hi); color: var(--text) !important; }
.btn-ghost:hover { background: var(--panel2); box-shadow: none; }

.hero { display: flex; gap: 18px; align-items: center; margin: 36px 0 8px; padding: 26px 24px; border-radius: var(--r);
  background: var(--panel); border: 1px solid var(--border); }
.hero h1 { font-size: 24px; margin-bottom: 4px; }
.hero p { margin: 0; }
.hero-ok { border-color: rgba(34,197,94,.25); }
.hero-minor { border-color: rgba(245,158,11,.3); }
.hero-major { border-color: rgba(239,68,68,.35); }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--dim); }
.hero .dot { width: 16px; height: 16px; }
.dot-ok { background: var(--green); box-shadow: 0 0 0 5px var(--green-bg); }
.dot-minor { background: var(--yellow); box-shadow: 0 0 0 5px var(--yellow-bg); }
.dot-major { background: var(--red); box-shadow: 0 0 0 5px var(--red-bg); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.card-link { color: var(--text); }
.card-link:hover { border-color: var(--border-hi); text-decoration: none; background: var(--panel2); }
.card-link p { margin: 0; }
.card-head { display: flex; align-items: center; gap: 10px; }
.card-head h3 { flex: 1; }
.flag { font-size: 22px; line-height: 1; }
.pill { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: var(--panel2); color: var(--dim); }
.pill-up { background: var(--green-bg); color: var(--green); }
.pill-down { background: var(--red-bg); color: var(--red); }
.pill-degraded { background: var(--yellow-bg); color: var(--yellow); }
.meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.meta dt { font-size: 12px; color: var(--dim); }
.meta dd { margin: 0; font-variant-numeric: tabular-nums; }
.bar { display: grid; grid-template-columns: repeat(90, 1fr); gap: 1px; height: 26px; }
.bar i { border-radius: 1px; background: var(--panel2); }
.bar .b-ok { background: var(--green); opacity: .85; }
.bar .b-minor { background: var(--yellow); }
.bar .b-major { background: var(--red); }
.bar i:hover { opacity: 1; outline: 1px solid var(--text); }
.bar-legend { display: flex; justify-content: space-between; font-size: 11px; margin-top: -6px; }

.services, .incidents { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r); }
.services li, .incidents li { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 13px 18px; border-top: 1px solid var(--border); }
.services li:first-child, .incidents li:first-child { border-top: 0; }
.incidents li { justify-content: flex-start; }

.cta { margin: 48px 0; padding: 28px 24px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r); text-align: center; }
.cta h2 { margin: 0 0 6px; }
.cta .btn { margin: 14px 6px 0; }

.page-h { font-size: 28px; margin: 36px 0 18px; }
.tag { align-self: flex-start; font-size: 12px; color: var(--accent); background: rgba(79,142,247,.08); border: 1px solid rgba(79,142,247,.2); padding: 2px 9px; border-radius: 999px; }
.post { max-width: 720px; margin: 32px auto 0; }
.post h1 { font-size: 30px; margin: 14px 0 6px; }
.post h2 { font-size: 21px; margin: 34px 0 10px; }
.post p, .post li { font-size: 16.5px; line-height: 1.7; }
.post .lead { font-size: 18px; color: #c9cdd6; }
.post blockquote { margin: 24px 0; padding: 14px 18px; border-left: 3px solid var(--accent); background: var(--panel); border-radius: 0 8px 8px 0; color: #c9cdd6; }
.post .tag { display: inline-block; margin-left: 10px; }

.chat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; margin-bottom: 48px; }
.chat-log { height: min(56vh, 520px); overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 78%; padding: 10px 14px; border-radius: 12px; display: flex; flex-direction: column; gap: 4px; white-space: pre-wrap; word-break: break-word; }
.msg-guest { align-self: flex-end; background: rgba(79,142,247,.16); border-bottom-right-radius: 4px; }
.msg-admin { align-self: flex-start; background: var(--panel2); border-bottom-left-radius: 4px; }
.chat-form { border-top: 1px solid var(--border); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-form input, .chat-form textarea { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--border-hi); border-radius: 8px; padding: 10px 12px; font: inherit; resize: vertical; }
.chat-form input:focus, .chat-form textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.chat-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.foot { display: flex; gap: 20px; padding-top: 24px; padding-bottom: 40px; border-top: 1px solid var(--border); margin-top: 40px; font-size: 13px; color: var(--dim); }
.foot a { color: var(--dim); }

@media (max-width: 640px) {
  nav a:not(.btn) { display: none; }
  nav a[href="/chat"] { display: inline; }
  .hero { padding: 20px 18px; }
  .hero h1 { font-size: 20px; }
  .grid { grid-template-columns: 1fr; }
  .post h1 { font-size: 24px; }
}

/* --- карта белых списков --- */
.map-lead { max-width: 760px; margin-top: -6px; }
.map-wrap { position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r); padding: 12px; margin: 18px 0 14px; }
.map { width: 100%; height: auto; display: block; }
.rg { stroke: var(--bg); stroke-width: 0.6; cursor: pointer; transition: opacity .12s; outline: none; }
.rg:hover, .rg:focus { opacity: .75; stroke: var(--text); stroke-width: 1; }
.lv-whitelist { fill: #ef4444; background: #ef4444; }
.lv-often { fill: #f97316; background: #f97316; }
.lv-history { fill: #a855f7; background: #a855f7; }
.lv-shutdowns { fill: #f59e0b80; background: #f59e0b80; }
.lv-none { fill: #2a2f3a; background: #2a2f3a; }
.map-tip { position: absolute; z-index: 3; max-width: 280px; padding: 10px 12px; border-radius: 8px; background: var(--panel2);
  border: 1px solid var(--border-hi); box-shadow: 0 8px 24px rgba(0,0,0,.4); font-size: 13px; pointer-events: none; display: grid; gap: 3px; }
.map-tip .lv { font-weight: 600; }
.lv-t-whitelist { color: #ef4444; } .lv-t-often { color: #f97316; } .lv-t-history { color: #c084fc; }
.lv-t-shutdowns { color: #f59e0b; } .lv-t-none { color: var(--dim); }
.legend { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--dim); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.map-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.map-stats div { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; display: grid; gap: 2px; }
.map-stats b { font-size: 26px; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .map-stats { grid-template-columns: 1fr; } .map-wrap { padding: 4px; } nav a[href="/karta"] { display: inline; } }
.map-tip[hidden] { display: none; }
