:root {
  --bg: #070a12;
  --bg-soft: #0b101b;
  --card: rgba(255, 255, 255, 0.065);
  --card-strong: rgba(255, 255, 255, 0.095);
  --line: rgba(255, 255, 255, 0.11);
  --text: #f5f7fb;
  --muted: #9aa4b5;
  --muted-2: #70798a;
  --accent: #7c5cff;
  --accent-2: #4f8cff;
  --ok: #20d6a1;
  --warning: #ffd166;
  --critical: #ff5c7a;
  --radius: 26px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% 0%, rgba(124, 92, 255, 0.18), transparent 32%),
    radial-gradient(circle at 100% 18%, rgba(32, 214, 161, 0.12), transparent 34%),
    linear-gradient(180deg, #070a12 0%, #080b13 100%);
  overflow-x: hidden;
}

button {
  font: inherit;
  color: inherit;
}

.app {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(22px + var(--safe-bottom));
}

.mobile-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 10px;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  background: rgba(7, 10, 18, 0.86);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.icon-button {
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
  display: grid;
  place-items: center;
  font-size: 22px;
  cursor: pointer;
}

.mobile-title {
  min-width: 0;
}

.app-name {
  font-size: 24px;
  line-height: 1.1;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.app-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-tabs {
  position: sticky;
  top: calc(67px + var(--safe-top));
  z-index: 19;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px 16px;
  background: rgba(7, 10, 18, 0.78);
  backdrop-filter: blur(18px);
}

.tab-button {
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  padding: 11px 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.tab-button.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--line);
}

.content {
  padding: 14px 16px 0;
}

.screen {
  display: none;
  animation: fadeIn 0.18s ease-out;
}

.screen.active {
  display: block;
}

.hero-card,
.quick-card,
.block,
.server-card,
.event-card,
.family-card,
.empty-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.04);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.26);
}

.hero-card {
  padding: 24px;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.eyebrow,
.quick-label,
.metric-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.status-word {
  font-size: clamp(48px, 14vw, 78px);
  line-height: 0.95;
  font-weight: 950;
  letter-spacing: -0.07em;
}

.status-dot {
  width: 16px;
  height: 16px;
  border-radius: 99px;
  background: var(--muted);
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.035);
}

.status-dot.ok {
  background: var(--ok);
}

.status-dot.warning {
  background: var(--warning);
}

.status-dot.critical {
  background: var(--critical);
}

.hero-summary {
  margin: 18px 0 0;
  color: #c8d0df;
  font-size: 18px;
  line-height: 1.42;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.quick-card {
  text-align: left;
  padding: 20px;
  cursor: pointer;
}

.quick-card strong {
  display: block;
  margin-top: 12px;
  font-size: 42px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.quick-card small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.block {
  margin-top: 12px;
  padding: 18px;
}

.block-head,
.screen-head {
  margin-bottom: 14px;
}

.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.block-head h2,
.screen-head h1,
.family-card h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.block-head span,
.screen-head p,
.family-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--accent-2);
  font-weight: 800;
  cursor: pointer;
}

.cards-list,
.events-list,
.family-grid {
  display: grid;
  gap: 12px;
}

.server-card {
  padding: 18px;
}

.server-top,
.event-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.server-title,
.event-title {
  font-size: 20px;
  font-weight: 850;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.server-subtitle,
.event-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.level-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.level-pill.ok {
  color: var(--ok);
  background: rgba(32, 214, 161, 0.1);
}

.level-pill.warning {
  color: var(--warning);
  background: rgba(255, 209, 102, 0.11);
}

.level-pill.critical {
  color: var(--critical);
  background: rgba(255, 92, 122, 0.11);
}

.server-summary,
.event-message {
  margin: 14px 0 0;
  color: #c8d0df;
  font-size: 16px;
  line-height: 1.45;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: #dce3f1;
  background: rgba(255, 255, 255, 0.045);
  font-size: 13px;
}

.event-card {
  padding: 18px;
}

.event-action {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  color: #cbd3e2;
  background: rgba(255, 255, 255, 0.045);
  font-size: 14px;
  line-height: 1.4;
}

.empty-card {
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.family-card {
  padding: 22px;
}

.family-icon {
  font-size: 42px;
  margin-bottom: 14px;
}

@media (min-width: 821px) {
  .app {
    max-width: 980px;
  }

  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cards-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .events-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .events-list.compact {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .app-name {
    font-size: 21px;
  }

  .tab-button {
    font-size: 13px;
    padding: 10px 4px;
  }

  .content {
    padding-left: 12px;
    padding-right: 12px;
  }

  .hero-card,
  .quick-card,
  .block,
  .server-card,
  .event-card,
  .family-card {
    border-radius: 22px;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
