/* BegetWatch — UI */
:root {
  --bg: #070b10;
  --panel: #0e1520;
  --panel-2: #111a26;
  --border: #1c2837;
  --border-soft: #16202c;
  --text: #e8f0f9;
  --muted: #8296ad;
  --muted-2: #5d7188;
  --green: #2ee6a8;
  --green-soft: rgba(46, 230, 168, 0.12);
  --red: #ff6b6b;
  --red-soft: rgba(255, 107, 107, 0.12);
  --amber: #ffc45c;
  --amber-soft: rgba(255, 196, 92, 0.12);
  --blue: #6aa7ff;
  --shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.9);
  --radius: 16px;
  --row: minmax(200px, 2fr) 132px 64px 84px minmax(180px, 1.5fr) 112px 106px;
  color-scheme: dark;
}

html[data-theme='light'] {
  --bg: #eef3f9;
  --panel: #ffffff;
  --panel-2: #f7fafd;
  --border: #dde7f1;
  --border-soft: #eaf0f7;
  --text: #0c1a2b;
  --muted: #5f7389;
  --muted-2: #8a9bb0;
  --green: #0fae7d;
  --green-soft: rgba(15, 174, 125, 0.12);
  --red: #e04848;
  --red-soft: rgba(224, 72, 72, 0.1);
  --amber: #c98a12;
  --amber-soft: rgba(201, 138, 18, 0.12);
  --blue: #2f6fd0;
  --shadow: 0 24px 60px -34px rgba(16, 40, 70, 0.35);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; }

button, input, select { font: inherit; color: inherit; }

.ambient {
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 640px;
  pointer-events: none;
  background:
    radial-gradient(560px 320px at 22% 12%, rgba(46, 230, 168, 0.13), transparent 70%),
    radial-gradient(620px 340px at 78% 0%, rgba(106, 167, 255, 0.12), transparent 70%);
  filter: blur(6px);
  z-index: 0;
}

html[data-theme='light'] .ambient {
  background:
    radial-gradient(560px 320px at 22% 10%, rgba(15, 174, 125, 0.16), transparent 70%),
    radial-gradient(620px 340px at 80% 0%, rgba(47, 111, 208, 0.12), transparent 70%);
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border-soft);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(145deg, #2ee6a8, #14b8a6 55%, #0e7490);
  color: #05221b;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.04em;
  box-shadow: 0 8px 22px -8px rgba(46, 230, 168, 0.7);
}

.brand-text {
  display: flex;
  flex-direction: column;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.brand-name { white-space: nowrap; }
.brand-accent { color: var(--green); }
.brand-text small {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-top: 3px;
}

.topbar-right { display: flex; align-items: center; gap: 12px; }

.live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  padding: 5px 11px 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
}
.live i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 0 rgba(255, 196, 92, 0.5);
  animation: livePulse 2s infinite;
}
.live.is-online i { background: var(--green); box-shadow: 0 0 0 0 rgba(46, 230, 168, 0.5); }
.live.is-offline i { background: var(--red); animation: none; }

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(46, 230, 168, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(46, 230, 168, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 230, 168, 0); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.btn:hover { border-color: color-mix(in srgb, var(--border) 40%, var(--muted)); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(160deg, #35f0b3, #16c598);
  border-color: transparent;
  color: #04211a;
  box-shadow: 0 10px 26px -12px rgba(46, 230, 168, 0.8);
}
.btn.primary:hover { box-shadow: 0 12px 30px -10px rgba(46, 230, 168, 0.9); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--muted-2); }

.ghost-btn {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border);
}
.ghost-btn:hover { color: var(--green); }

.auth-btn { max-width: 210px; }
.auth-btn #authLabel {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 150px;
}
.auth-btn.is-admin {
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 32%, transparent);
  background: var(--green-soft);
}

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 40px;
  align-items: end;
  padding: 56px 0 40px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(36px, 4.6vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 800;
}

.grad {
  background: linear-gradient(92deg, #2ee6a8 5%, #63d8ff 60%, #6aa7ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  margin: 0;
  max-width: 560px;
  color: var(--muted);
  font-size: 15px;
}

.beget-card {
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 92%, transparent), var(--panel));
  border-radius: var(--radius);
  padding: 18px 18px 14px;
  box-shadow: var(--shadow);
}

.beget-card-head { display: flex; align-items: center; gap: 11px; }

.beget-logo {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: #1a2533;
  border: 1px solid #253345;
  color: #ffd24a;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
}
html[data-theme='light'] .beget-logo { background: #fff7dd; border-color: #f3e3b0; color: #b8860b; }

.beget-card-head div { display: flex; flex-direction: column; }
.beget-card-head strong { font-size: 14.5px; }
.beget-card-head span { font-size: 11.5px; color: var(--muted); letter-spacing: 0.04em; }

.beget-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0 12px;
  padding: 13px 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}
.beget-stats div { display: flex; flex-direction: column; gap: 3px; }
.beget-stats dt { font-size: 11px; color: var(--muted-2); }
.beget-stats dd { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.beget-foot { margin: 0; font-size: 11.5px; color: var(--muted-2); }
.auto-row { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.auto-row .ghost-btn { margin-left: auto; flex: none; }

/* ---------- promo banner ---------- */
.promo {
  position: relative;
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 0 0 18px;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  background:
    radial-gradient(420px 130px at 12% 0%, var(--green-soft), transparent 72%),
    radial-gradient(360px 140px at 88% 100%, rgba(106, 167, 255, 0.1), transparent 70%),
    var(--panel);
  transition: border-color 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
}
.promo:hover {
  border-color: color-mix(in srgb, var(--green) 38%, var(--border));
  transform: translateY(-1px);
  box-shadow: 0 18px 40px -28px rgba(46, 230, 168, 0.55);
}

.promo-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.promo-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}
.promo-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.promo-arrow {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--green) 28%, var(--border));
  color: var(--green);
  background: var(--green-soft);
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.promo:hover .promo-arrow {
  background: var(--green);
  border-color: var(--green);
  color: #04211a;
  transform: translateX(2px);
}

/* ---------- stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

.stat {
  position: relative;
  overflow: hidden;
  padding: 15px 16px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
}
.stat::before {
  content: '';
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--border);
}
.stat.ok::before { background: var(--green); }
.stat.bad::before { background: var(--red); }
.stat-label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 7px; }
.stat strong { display: block; font-size: 26px; font-weight: 750; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat.ok strong { color: var(--green); }
.stat.bad strong { color: var(--red); }
.stat small { display: block; margin-top: 7px; font-size: 11px; color: var(--muted-2); min-height: 14px; }

/* ---------- panel / toolbar ---------- */
.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
}

.chips { display: flex; gap: 6px; flex-wrap: wrap; }

.chip {
  height: 32px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 0.15s, color 0.15s;
}
.chip b {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}
.chip:hover { color: var(--text); background: var(--panel-2); }
.chip.is-active { color: var(--text); background: var(--panel-2); border-color: var(--border); }
.chip.is-active b { color: var(--green); border-color: color-mix(in srgb, var(--green) 30%, transparent); background: var(--green-soft); }

.tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--muted-2);
  width: 214px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search:focus-within { border-color: color-mix(in srgb, var(--green) 45%, var(--border)); box-shadow: 0 0 0 3px var(--green-soft); }
.search input {
  border: 0; outline: 0; background: transparent;
  width: 100%; font-size: 13.5px; color: var(--text);
}
.search input::placeholder { color: var(--muted-2); }

.select {
  height: 38px;
  padding: 0 30px 0 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%238296ad' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    no-repeat right 10px center;
  font-size: 13px;
  color: var(--text);
  appearance: none;
  cursor: pointer;
  outline: none;
}
.select:focus { border-color: var(--muted-2); }

/* ---------- table ---------- */
.table-head, .row {
  display: grid;
  grid-template-columns: var(--row);
  gap: 18px;
  align-items: center;
  padding: 0 20px;
}

.table-head {
  height: 40px;
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted-2);
  border-bottom: 1px solid var(--border-soft);
  background: color-mix(in srgb, var(--panel-2) 60%, transparent);
}

.rows { display: flex; flex-direction: column; }

.row {
  min-height: 68px;
  padding-top: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.15s;
}
.rows.anim .row { animation: rowIn 0.35s ease both; }
.rows .row:last-child { border-bottom: 0; }
.row:hover { background: color-mix(in srgb, var(--panel-2) 65%, transparent); }

@keyframes rowIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.site-cell { min-width: 0; }
.site-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  font-size: 14.5px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
}
.site-name > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.site-url {
  display: block;
  font-size: 12px;
  color: var(--muted-2);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.site-url:hover { color: var(--blue); }

.tag-beget {
  flex: none;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffd24a;
  background: rgba(255, 210, 74, 0.1);
  border: 1px solid rgba(255, 210, 74, 0.22);
  border-radius: 5px;
  padding: 1px 5px;
}
html[data-theme='light'] .tag-beget { color: #9a6b00; background: #fff6da; border-color: #f0dfae; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  border: 1px solid transparent;
  white-space: nowrap;
  width: fit-content;
}
.status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.up { color: var(--green); background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 22%, transparent); }
.status.down { color: var(--red); background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 22%, transparent); }
.status.unknown { color: var(--muted); background: var(--panel-2); border-color: var(--border); }
.status.checking { color: var(--amber); background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 22%, transparent); }
.status.checking i { animation: livePulse 1.2s infinite; }

.code { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--muted); }
.code.bad { color: var(--red); font-weight: 650; }

.ms { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text); }
.ms small { color: var(--muted-2); font-size: 11px; margin-left: 1px; }
.ms.slow { color: var(--amber); }
.ms.bad { color: var(--muted-2); }

.uptime { min-width: 0; }
.uptime-top {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 5px;
  font-size: 11px;
  color: var(--muted-2);
}
.uptime-top b { font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums; }
.uptime-top .num { color: var(--muted); }
.uptime-top .num em { font-style: normal; color: var(--muted-2); }

.bars {
  height: 24px;
  border-radius: 2px;
  background-color: var(--border-soft);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.checked { font-size: 12px; color: var(--muted-2); white-space: nowrap; }
.checked b { display: block; font-weight: 500; color: var(--muted); font-size: 12.5px; }

.row-actions { display: flex; gap: 4px; justify-content: flex-end; opacity: 0.45; transition: opacity 0.15s; }
.row:hover .row-actions, .row:focus-within .row-actions { opacity: 1; }
.act {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.act:hover { color: var(--text); background: var(--panel-2); border-color: var(--border); }
.act.danger:hover { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); background: var(--red-soft); }
.act.bell:hover { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 35%, transparent); background: var(--amber-soft); }
.act.bell.on { color: var(--green); background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 26%, transparent); }
.act:disabled { opacity: 0.4; cursor: default; }
.act.spin svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- empty ---------- */
.empty { padding: 64px 24px 72px; text-align: center; }
.empty-art {
  width: 64px; height: 64px; margin: 0 auto 16px;
  display: grid; place-items: center;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--muted-2);
  font-size: 28px;
}
.empty h3 { margin: 0 0 6px; font-size: 17px; letter-spacing: -0.01em; }
.empty p { margin: 0 0 20px; color: var(--muted); font-size: 13.5px; }

/* ---------- footer ---------- */
.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 26px 4px 40px;
  color: var(--muted-2);
  font-size: 11.5px;
}
.foot a { color: var(--muted); text-underline-offset: 2px; }
.foot a:hover { color: var(--green); }

/* ---------- dialog ---------- */
.dialog {
  width: min(480px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 40px 120px -20px rgba(0, 0, 0, 0.7);
}
.dialog::backdrop { background: rgba(3, 8, 14, 0.65); backdrop-filter: blur(6px); }
.dialog form { padding: 22px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; }
.dialog-head h2 { margin: 0; font-size: 19px; letter-spacing: -0.02em; }
.dialog-sub { margin: 8px 0 20px; color: var(--muted); font-size: 13px; }

.field { display: block; margin-bottom: 14px; }
.field[hidden] { display: none; }

.auth-msg { margin: 0 0 4px; min-height: 18px; font-size: 12.5px; color: var(--muted); }
.auth-msg.err { color: var(--red); }
.auth-msg.ok { color: var(--green); }
.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field > span em { font-style: normal; color: var(--muted-2); }
.field input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  outline: none;
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus { border-color: color-mix(in srgb, var(--green) 55%, var(--border)); box-shadow: 0 0 0 3px var(--green-soft); }
.field input::placeholder { color: var(--muted-2); }

.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

/* ---------- toasts ---------- */
.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  pointer-events: none;
}
.toast {
  max-width: 340px;
  padding: 11px 14px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.8);
  animation: toastIn 0.25s ease both;
  pointer-events: auto;
}
.toast.ok { border-color: color-mix(in srgb, var(--green) 38%, transparent); }
.toast.err { border-color: color-mix(in srgb, var(--red) 38%, transparent); }
.toast.out { animation: toastOut 0.25s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; gap: 26px; align-items: start; }
  .beget-card { max-width: 440px; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  :root { --row: minmax(180px, 2fr) 120px 56px 76px minmax(150px, 1.4fr) 96px 102px; }
  .table-head, .row { gap: 12px; padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 980px) {
  .wrap { width: calc(100% - 28px); }
  .hero { padding: 36px 0 28px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(5) { grid-column: span 2; }
  .toolbar { padding: 12px; }
  .tools { width: 100%; }
  .search { flex: 1 1 160px; width: auto; }
  .check-all-label { display: none; }

  .table-head { display: none; }
  .rows { padding: 10px; gap: 10px; }
  .row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      'site status'
      'site ms'
      'uptime uptime'
      'foot actions';
    gap: 8px 12px;
    padding: 14px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: var(--panel-2);
  }
  .row:hover { background: var(--panel-2); }
  .site-cell { grid-area: site; }
  .cell-status { grid-area: status; justify-self: end; }
  .cell-code { display: none; }
  .cell-ms { grid-area: ms; justify-self: end; }
  .cell-uptime { grid-area: uptime; }
  .cell-checked { grid-area: foot; }
  .row-actions { grid-area: actions; opacity: 1; }
  .site-name { font-size: 14px; }
  .site-url { max-width: 52vw; }
}

@media (max-width: 560px) {
  .topbar-inner { height: 60px; }
  .brand-text small { display: none; }
  .auth-btn { max-width: 42px; padding: 0 10px; }
  .auth-btn #authLabel { display: none; }
  .live span { display: none; }
  .live { padding: 6px; }
  .btn .label { display: none; }
  .hero h1 { font-size: 34px; }
  .hero p { font-size: 14px; }
  .beget-card { max-width: none; }
  .promo { gap: 12px; padding: 14px 15px; }
  .promo-title { font-size: 15px; }
  .promo-text { font-size: 12.5px; }
  .promo-arrow { width: 36px; height: 36px; border-radius: 10px; }
  .stats { gap: 8px; }
  .stat { padding: 12px; }
  .stat strong { font-size: 22px; }
  .chip { padding: 0 9px; font-size: 12px; }
  .chip b { display: none; }
  .tools { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
  .search { grid-column: 1 / -1; }
  .select { width: 100%; }
  .foot { flex-direction: column; }
  .dialog form { padding: 18px; }
}

@media (max-width: 400px) {
  .topbar-inner { gap: 8px; }
  .brand { gap: 8px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 9px; font-size: 18px; }
  .brand-text { font-size: 15px; }
  .topbar-right { gap: 6px; }
  .icon-btn, .auth-btn { width: 34px; height: 34px; }
  .topbar .btn { padding: 0 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
