/*
 * Страница статуса Zypo. Дизайн-код сайта без сборки.
 * Ритм: шаг 3 = 12px (--s) между блоками и внутри них; 24px (--s2) — только перед группой/заголовком и у края страницы.
 * Скругления: только 24px (карточки) и полные (кнопки, пиллы, поля). Рамки: 1px zinc-600/30.
 * Цвет — только у состояний: спокойные дни серые, внимание привлекают сбои и «Сейчас».
 */
:root {
  --bg: #000;
  --fg: #fff;
  --zinc-100: #f4f4f5; --zinc-300: #d4d4d8; --zinc-400: #a1a1aa; --zinc-500: #71717a; --zinc-600: #52525b;
  --zinc-800: #27272a; --zinc-900: #18181b;
  --line: rgb(82 82 91 / 0.3);
  --surface: rgb(24 24 27 / 0.5);
  --ok: #34d399; --warn: #fbbf24; --bad: #f87171;
  --radius: 1.5rem;
  --s: 0.75rem;
  --s2: 1.5rem;
  --gap: var(--s);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100dvh; color: var(--fg); background: var(--bg);
  font-family: 'Geist', system-ui, -apple-system, sans-serif; font-size: 16px; line-height: 1.5;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
::selection { background: rgb(255 255 255 / 0.2); }
.wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 var(--s); }

/* ── Шапка ─────────────────────────────────────────────── */
/* Шапка приклеена сверху: чёрный градиент to-b from-black via-black/90 to-transparent, без нижней границы */
.top { position: sticky; top: 0; z-index: 20; background: linear-gradient(to bottom, #000, rgb(0 0 0 / 0.9), transparent); pointer-events: none; }
.top a, .top form, .langs { pointer-events: auto; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: var(--s); height: 4rem; }
.logo img { display: block; height: 2rem; width: auto; }
.langs { display: flex; padding: 0.25rem; border: 1px solid var(--line); border-radius: 9999px; background: var(--surface); }
.lang { padding: 0.25rem var(--s); border-radius: 9999px; font-size: 0.8125rem; line-height: 1.5rem; color: var(--zinc-400); cursor: pointer; transition: color 300ms, background-color 300ms; }
.lang:hover { color: var(--fg); }
.lang.on { color: var(--fg); background: var(--zinc-800); }

/* ── Заголовок страницы ────────────────────────────────── */
.head { display: flex; align-items: center; justify-content: space-between; gap: var(--s); margin: var(--s) 0; }
h1 { margin: 0; font-size: 1.75rem; line-height: 2.5rem; font-weight: 600; letter-spacing: -0.02em; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 2.5rem; padding: 0 1rem; border: 0; border-radius: 9999px; background: #fff; color: #000; font-weight: 500; font-size: 0.9375rem; line-height: 1; cursor: pointer; transition: background-color 300ms, transform 300ms; white-space: nowrap; }
.btn:hover { background: var(--zinc-300); }
.btn:active, .tab:active, .lang:active { transform: scale(0.95); }

.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }

/* ── Баннер статуса ────────────────────────────────────── */
.banner { display: flex; align-items: center; gap: var(--s); padding: var(--s); margin-bottom: var(--s); border: 1px solid var(--line); border-radius: var(--radius); }
.banner-icon { display: flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: 9999px; flex: none; }
.dot { width: 0.75rem; height: 0.75rem; border-radius: 9999px; background: currentColor; }
.banner-text { display: flex; flex-direction: column; min-width: 0; }
.banner-text strong { font-size: 1.125rem; line-height: 1.5rem; font-weight: 600; color: var(--fg); }
.banner-text span { font-size: 0.875rem; line-height: 1.25rem; color: var(--zinc-300); overflow-wrap: anywhere; }
.banner-text .muted { color: var(--zinc-500); }
.tone-ok { color: var(--ok); background: radial-gradient(60% 320% at 0% 50%, rgb(52 211 153 / 0.14), transparent 70%), var(--surface); }
.tone-warn { color: var(--warn); background: radial-gradient(60% 320% at 0% 50%, rgb(251 191 36 / 0.14), transparent 70%), var(--surface); }
.tone-bad { color: var(--bad); background: radial-gradient(60% 320% at 0% 50%, rgb(248 113 113 / 0.16), transparent 70%), var(--surface); }
.tone-none { color: var(--zinc-400); background: var(--surface); }
.tone-ok .banner-icon { background: rgb(52 211 153 / 0.16); animation: breathe 3.2s ease-in-out infinite; }
.tone-warn .banner-icon { background: rgb(251 191 36 / 0.16); }
.tone-bad .banner-icon { background: rgb(248 113 113 / 0.18); }
.tone-none .banner-icon { background: rgb(82 82 91 / 0.25); }
@keyframes breathe { 50% { box-shadow: 0 0 0 6px rgb(52 211 153 / 0.08); } }

/* ── Вкладки (сегментный переключатель) ────────────────── */
.tabs { display: inline-flex; max-width: 100%; margin-bottom: var(--s); padding: 0.25rem; border: 1px solid var(--line); border-radius: 9999px; background: var(--surface); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 0 1rem; height: 2rem; border: 0; border-radius: 9999px; background: none; color: var(--zinc-400); font-size: 0.9375rem; cursor: pointer; transition: color 300ms, background-color 300ms, transform 300ms; }
.tab:hover { color: var(--fg); }
.tab.on { color: var(--fg); background: var(--zinc-800); }

/* ── Фильтр ────────────────────────────────────────────── */
.filter { display: block; margin-bottom: var(--s); }
.filter input { width: 100%; max-width: 22rem; height: 2.5rem; padding: 0 1rem; border-radius: 9999px; border: 1px solid var(--line); background: var(--surface); outline: none; transition: border-color 300ms; }
.filter input::placeholder { color: var(--zinc-500); }
.filter input:focus { border-color: var(--zinc-500); }

/* ── Таблица сервисов ──────────────────────────────────── */
.table { overflow: hidden; }
.tr { display: grid; grid-template-columns: minmax(0, 1fr) repeat(5, 4.5rem) 4.5rem 4.5rem 6.75rem; align-items: center; column-gap: var(--s); padding: var(--s); border-top: 1px solid var(--line); }
.tr.th { border-top: 0; }
.tr[hidden] { display: none; }
.th { color: var(--zinc-500); font-size: 0.8125rem; }
.th .c-now { color: var(--fg); font-weight: 600; }
.c-day, .c-now { text-align: center; }
.th .c-day { white-space: nowrap; }
.c-name { display: flex; align-items: center; gap: var(--s); min-width: 0; flex-wrap: wrap; }
.name { font-weight: 500; }
/* Стрелка: строку можно раскрыть */
.row .name::after { content: ''; display: inline-block; width: 0.375rem; height: 0.375rem; margin-left: var(--s); border-right: 1.5px solid var(--zinc-500); border-bottom: 1.5px solid var(--zinc-500); transform: translateY(-2px) rotate(45deg); transition: transform 300ms, border-color 300ms; }
.row:hover .name::after { border-color: var(--fg); }
.row[aria-expanded="true"] .name::after { transform: translateY(1px) rotate(-135deg); }
.chip { padding: 0.375rem var(--s); border-radius: 9999px; font-size: 0.75rem; line-height: 1; color: var(--zinc-300); background: var(--zinc-800); border: 1px solid var(--line); white-space: nowrap; }

.pill { position: relative; display: inline-block; min-width: 4rem; padding: 0.375rem var(--s); border-radius: 9999px; font-size: 0.875rem; line-height: 1.25rem; text-align: center; white-space: nowrap; }
.pill.now { min-width: 5.5rem; font-weight: 500; }
.s-ok { color: var(--ok); background: rgb(52 211 153 / 0.1); }
.s-warn { color: var(--warn); background: rgb(251 191 36 / 0.12); }
.s-bad { color: var(--bad); background: rgb(248 113 113 / 0.14); }
.s-none { color: var(--zinc-500); background: rgb(82 82 91 / 0.15); }
/* Нормальные дни — тихие: цвет достаётся только сбоям и текущему состоянию */
.c-day .pill.s-ok { color: var(--zinc-400); background: rgb(255 255 255 / 0.04); }
.c-day .pill.s-none { color: var(--zinc-600); background: transparent; }

/* ── Подсказки (data-tip, как на сайте) ────────────────── */
[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 0.375rem); transform: translateX(-50%);
  z-index: 10; padding: 0.375rem var(--s); border-radius: 9999px; border: 1px solid var(--line);
  background: var(--zinc-800); color: var(--zinc-100); font-size: 0.75rem; line-height: 1.25rem; font-weight: 400; white-space: nowrap; pointer-events: none;
}

/* ── Строки и подробности ──────────────────────────────── */
.row { cursor: pointer; transition: background-color 300ms; }
.row:hover, .row[aria-expanded="true"] { background: rgb(39 39 42 / 0.35); }
.row:focus-visible { outline: 1px solid var(--zinc-500); outline-offset: -1px; }
.detail { padding: var(--s); border-top: 1px solid var(--line); background: rgb(0 0 0 / 0.3); }
.detail[hidden] { display: none; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s); }
.stats.small { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { display: flex; flex-direction: column; padding: var(--s); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.stat span { font-size: 0.75rem; line-height: 1.25rem; color: var(--zinc-400); }
.stat strong { font-size: 1.125rem; line-height: 1.5rem; font-weight: 600; white-space: nowrap; }
.detail-label { margin: var(--s2) 0 var(--s); font-size: 0.8125rem; color: var(--zinc-400); }
.detail > .stats + .detail-label, .nr > .detail-label:first-child { margin-top: var(--s2); }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 3.5rem; }
.bar { position: relative; flex: 1 1 0; min-width: 0; border-radius: 9999px; background: var(--zinc-600); opacity: 0.9; transition: opacity 300ms; }
.bar.s-ok { background: var(--ok); opacity: 0.5; }
.bar.s-warn { background: var(--warn); opacity: 0.85; }
.bar.s-bad { background: var(--bad); opacity: 1; }
.bar.s-none { background: var(--zinc-600); opacity: 0.3; }
.bar:hover { opacity: 1; }
.daylist { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: var(--s); }
.dayitem { display: flex; flex-direction: column; font-size: 0.8125rem; color: var(--zinc-400); }
.dayitem strong { color: var(--fg); font-size: 1rem; font-weight: 500; }
.dayitem small { color: var(--zinc-500); }
.c-now { display: flex; flex-direction: column; align-items: center; }
.ms { font-size: 0.75rem; line-height: 1.5; color: var(--zinc-400); }

/* ── Серверы ───────────────────────────────────────────── */
.servers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s); }
.server { padding: var(--s); }
.server-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s); margin-bottom: var(--s); font-size: 1.125rem; }
.server .stats { margin-bottom: var(--s); }
.server-rows { display: flex; flex-direction: column; }
.srow { display: grid; grid-template-columns: minmax(0, 1fr) auto 6.5rem; align-items: center; column-gap: var(--s); padding: var(--s) 0; border-top: 1px solid var(--line); }
.srow:first-child { border-top: 0; padding-top: 0; }
.srow:last-child { padding-bottom: 0; }
.srow .ms { font-size: 0.8125rem; }

/* ── Подробности New Relic ─────────────────────────────── */
.timing { display: flex; height: 0.75rem; border-radius: 9999px; overflow: hidden; background: var(--zinc-800); gap: 2px; }
.seg { position: relative; display: block; height: 100%; min-width: 2px; }
.seg-dns { background: #60a5fa; } .seg-connect { background: #a78bfa; } .seg-ssl { background: #f472b6; } .seg-wait { background: #fbbf24; } .seg-receive { background: #34d399; }
.legend { display: flex; flex-wrap: wrap; gap: var(--s); margin-top: var(--s); font-size: 0.8125rem; color: var(--zinc-300); }
.legend span { display: inline-flex; align-items: center; gap: 0.375rem; }
.legend i { width: 0.5rem; height: 0.5rem; border-radius: 9999px; }
.legend .seg-dns { background: #60a5fa; } .legend .seg-connect { background: #a78bfa; } .legend .seg-ssl { background: #f472b6; } .legend .seg-wait { background: #fbbf24; } .legend .seg-receive { background: #34d399; }
.loctable { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.lrow { display: grid; grid-template-columns: minmax(0, 1fr) 6rem 6rem 6rem 6rem; column-gap: var(--s); align-items: center; padding: var(--s); border-top: 1px solid var(--line); font-size: 0.875rem; }
.lrow:first-child { border-top: 0; }
.lrow span:not(.lname) { text-align: right; white-space: nowrap; }
.lhead { color: var(--zinc-500); font-size: 0.8125rem; }
.lrow.lhead span:first-child { text-align: left; }
.lname { display: flex; align-items: center; gap: var(--s); min-width: 0; }
.dot-s { flex: none; width: 0.5rem; height: 0.5rem; border-radius: 9999px; background: currentColor; }
.dot-s.s-ok { color: var(--ok); background: currentColor; } .dot-s.s-warn { color: var(--warn); background: currentColor; } .dot-s.s-bad { color: var(--bad); background: currentColor; }
.errbox { padding: var(--s); border: 1px solid var(--line); border-radius: var(--radius); background: rgb(248 113 113 / 0.06); color: var(--zinc-300); font-size: 0.875rem; overflow-wrap: anywhere; }

/* ── Карта мира ────────────────────────────────────────── */
.map { position: relative; width: 100%; aspect-ratio: 1000 / 390.8; margin-bottom: var(--s); background: url('world.svg') center / 100% 100% no-repeat; }
.stats + .map { margin-top: var(--s); }
.mk { position: absolute; width: 0.75rem; height: 0.75rem; transform: translate(-50%, -50%); border-radius: 9999px; cursor: pointer; }
.mk.s-ok { background: var(--ok); box-shadow: 0 0 0 4px rgb(52 211 153 / 0.2); }
.mk.s-warn { background: var(--warn); box-shadow: 0 0 0 4px rgb(251 191 36 / 0.25); }
.mk.s-bad { background: var(--bad); box-shadow: 0 0 0 4px rgb(248 113 113 / 0.3); animation: mk-pulse 1.6s ease-in-out infinite; }
.mk:hover { z-index: 5; }
@keyframes mk-pulse { 50% { box-shadow: 0 0 0 8px rgb(248 113 113 / 0.05); } }
.muted { color: var(--zinc-400); font-size: 0.875rem; }

/* ── История событий и объявления ──────────────────────── */
.tab-pane { margin-bottom: var(--s2); }
.empty { padding: var(--s2); text-align: center; color: var(--zinc-400); }
.event { padding: var(--s); margin-bottom: var(--s); }
.tab-pane > .event:last-child { margin-bottom: 0; }
.event-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s); flex-wrap: wrap; }
.event-head strong { font-weight: 600; }
.event-meta { margin-top: var(--s); font-size: 0.875rem; color: var(--zinc-400); }
.event-body { margin: var(--s) 0 0; color: var(--zinc-300); font-size: 0.9375rem; overflow-wrap: anywhere; }
.updates { list-style: none; margin: var(--s) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s); }
.updates li { padding-left: var(--s); border-left: 2px solid var(--line); color: var(--zinc-300); font-size: 0.875rem; overflow-wrap: anywhere; }
.updates li span { display: block; color: var(--zinc-500); font-size: 0.75rem; }

/* ── Футер ─────────────────────────────────────────────── */
.foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s); flex-wrap: wrap; margin: 0; padding: var(--s2) 0; font-size: 0.875rem; color: var(--zinc-500); }
.foot-links { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s) var(--s2); }
.foot-links a { transition: color 300ms; }
.foot-links a:hover { color: var(--fg); }
.socials { display: flex; gap: var(--s); }
.social { position: relative; display: flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: 9999px; cursor: pointer; opacity: 0.5; transition: opacity 300ms, transform 300ms; }
.social:hover { opacity: 1; }
.social:active { transform: scale(0.95); }
.social img { display: block; width: 1.5rem; height: 1.5rem; }
/* Кнопка 40px, иконка 24px: тултип подтягиваем к самой иконке */
.social[data-tip]:hover::after { bottom: calc(100% - 0.5rem); }

/* ── Админка ───────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: var(--s); padding: var(--s); margin-bottom: var(--s); }
.form.narrow { max-width: 26rem; }
.form h2, h2.section { margin: 0; font-size: 1.125rem; font-weight: 600; }
h2.section { margin: var(--s2) 0 var(--s); }
.form label { display: flex; flex-direction: column; gap: 0.375rem; font-size: 0.8125rem; color: var(--zinc-400); }
.form input, .form select, .form textarea { font-size: 1rem; color: var(--fg); background: var(--surface); border: 1px solid var(--line); outline: none; transition: border-color 300ms; }
.form input, .form select { height: 2.5rem; padding: 0 1rem; border-radius: 9999px; }
.form textarea { padding: var(--s) 1rem; border-radius: var(--radius); resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--zinc-500); }
.form select option { background: var(--zinc-900); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s); }
.form-error { margin: 0; color: var(--bad); font-size: 0.875rem; }
.hint { margin: 0; color: var(--zinc-500); font-size: 0.8125rem; }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--zinc-800); }
.btn.danger { background: rgb(248 113 113 / 0.15); color: var(--bad); }
.btn.danger:hover { background: rgb(248 113 113 / 0.25); }
.form > .btn:not(.ghost):not(.danger) { align-self: flex-start; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s); }
.inline { margin: 0; }
.inline-form { padding: 0; margin: var(--s) 0 0; }
.pills { display: inline-flex; align-items: center; gap: var(--s); flex-wrap: wrap; }
.edit { margin-top: var(--s); }
.edit summary { display: inline-flex; align-items: center; height: 2.5rem; padding: 0 1rem; border: 1px solid var(--line); border-radius: 9999px; color: var(--zinc-300); font-size: 0.9375rem; cursor: pointer; transition: background-color 300ms; list-style: none; }
.edit summary::-webkit-details-marker { display: none; }
.edit summary:hover { background: var(--zinc-800); }
.edit[open] summary { margin-bottom: var(--s); }

/* ── Адаптив ───────────────────────────────────────────── */
@media (max-width: 1000px) {
  .tr { grid-template-columns: minmax(0, 1fr) 4.5rem 4.5rem 6.75rem; }
  .d-old { display: none; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .servers { grid-template-columns: minmax(0, 1fr); }
  .stats, .stats.small { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lrow { grid-template-columns: minmax(0, 1fr) 5rem 5rem; }
  .lrow span:nth-child(4), .lrow span:nth-child(5) { display: none; }
  .mk { width: 0.5rem; height: 0.5rem; }
}
@media (max-width: 640px) {
  h1 { font-size: 1.5rem; }
  .tr { grid-template-columns: minmax(0, 1fr) 4.5rem 5.5rem; }
  .d-yest { display: none; }
  .pill { min-width: 3.5rem; }
  .pill.now { min-width: 5rem; }
  /* Телефон: название, под ним сервер мелким текстом — строка вдвое ниже */
  .tr:not(.th) .c-name { flex-direction: column-reverse; align-items: flex-start; flex-wrap: nowrap; gap: 0; }
  .tr:not(.th) .chip { padding: 0; border: 0; background: none; color: var(--zinc-500); font-size: 0.75rem; line-height: 1.25rem; }
  .foot { flex-direction: column; text-align: center; }
  .foot-links { justify-content: center; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
