:root {
  color-scheme: dark;
  --bg: #090b0d;
  --panel: #11161a;
  --line: #26323a;
  --text: #ecf2f4;
  --muted: #93a4ab;
  --accent: #52d273;
  --warn: #ffc845;
  --danger: #ff4f5f;
  --cyan: #50d8ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.device {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(260px, 360px);
  gap: 1px;
  background: var(--line);
}

.radar-panel,
.numbers-panel {
  min-width: 0;
  background: var(--panel);
}

.radar-panel {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
}

canvas {
  width: min(100vw, calc(100vh - 32px), 100%);
  height: min(100vw, calc(100vh - 32px), 100%);
  max-width: 100%;
  max-height: 100%;
}

.status-strip {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.numbers-panel {
  display: flex;
  flex-direction: column;
  padding: 18px;
  gap: 18px;
  border-left: 1px solid var(--line);
}

header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow,
dt {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  font-weight: 700;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 16px;
}

.alert-state {
  min-width: 64px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: center;
  font-size: 14px;
}

.alert-state.warn {
  border-color: color-mix(in srgb, var(--warn), transparent 35%);
  color: var(--warn);
}

.alert-state.danger {
  border-color: color-mix(in srgb, var(--danger), transparent 30%);
  color: var(--danger);
  animation: pulse 0.9s infinite alternate;
}

.metrics {
  display: grid;
  gap: 10px;
  margin: 0;
}

.metrics div,
.traffic-row {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #0c1114;
}

dd {
  margin: 6px 0 0;
  font-size: 28px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.target-list {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#traffic {
  display: grid;
  gap: 8px;
  overflow: auto;
}

.traffic-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
}

.traffic-row strong {
  font-size: 15px;
}

.traffic-row span {
  color: var(--muted);
  font-size: 12px;
}

.badge {
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
}

.badge.warn {
  color: var(--warn);
}

.badge.danger {
  color: var(--danger);
}

@keyframes pulse {
  from {
    background: transparent;
  }
  to {
    background: rgba(255, 79, 95, 0.18);
  }
}

@media (max-width: 760px) {
  .device {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(360px, 55vh) auto;
  }

  .numbers-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  dd {
    font-size: 24px;
  }
}

.home-page {
  min-height: 100%;
  background:
    linear-gradient(180deg, rgba(80, 216, 255, 0.08), transparent 320px),
    var(--bg);
}

.home-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 48px;
}

.home-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  padding: 26px 0 30px;
  border-bottom: 1px solid var(--line);
}

.home-kicker {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.home-header h1 {
  font-size: clamp(34px, 6vw, 68px);
  line-height: 0.95;
}

.home-lead {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.home-primary,
.link-card,
.compact-links a,
.docs-list a,
.ops-grid a {
  color: inherit;
  text-decoration: none;
}

.home-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 35%);
  border-radius: 6px;
  background: rgba(82, 210, 115, 0.12);
  color: var(--accent);
  font-weight: 800;
  white-space: nowrap;
}

.home-section {
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 16px;
}

.section-heading h2 {
  font-size: 22px;
}

.section-heading p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.link-card {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c1114;
}

.link-card:hover,
.compact-links a:hover,
.docs-list a:hover {
  border-color: color-mix(in srgb, var(--cyan), transparent 30%);
}

.link-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.link-card strong {
  font-size: 23px;
  line-height: 1.08;
}

.link-card small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.link-card.is-main {
  background: linear-gradient(180deg, rgba(82, 210, 115, 0.16), #0c1114);
  border-color: color-mix(in srgb, var(--accent), transparent 38%);
}

.link-card.is-apk {
  background: linear-gradient(180deg, rgba(255, 200, 69, 0.14), #0c1114);
  border-color: color-mix(in srgb, var(--warn), transparent 34%);
}

.compact-links,
.docs-list,
.ops-grid {
  display: grid;
  gap: 10px;
}

.compact-links {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-links a,
.docs-list a,
.ops-grid div {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0c1114;
}

.compact-links a {
  min-height: 62px;
  display: flex;
  align-items: center;
  padding: 12px;
  font-weight: 700;
}

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

.docs-list a,
.ops-grid div {
  padding: 13px;
}

.docs-list span,
.ops-grid b {
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
}

.docs-list small,
.ops-grid span {
  color: var(--muted);
  line-height: 1.45;
}

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

.ops-grid a {
  color: var(--cyan);
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .home-header,
  .section-heading {
    display: block;
  }

  .home-primary {
    margin-top: 18px;
  }

  .section-heading p {
    margin-top: 8px;
  }

  .link-grid,
  .compact-links,
  .docs-list,
  .ops-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .home-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .link-grid,
  .compact-links,
  .docs-list,
  .ops-grid {
    grid-template-columns: 1fr;
  }
}
