:root {
  color-scheme: light dark;
  --bg: #f3f6f8;
  --panel: #ffffff;
  --ink: #14212b;
  --muted: #667789;
  --line: #d9e1e8;
  --off: #8b99a8;
  --on: #1f9d70;
  --accent: #e8b84a;
  --danger: #b42318;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 15%, rgba(232, 184, 74, 0.22), transparent 30%),
    linear-gradient(135deg, #eff4f7 0%, #dce7ed 52%, #c9d7df 100%);
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.panel {
  width: min(100%, 520px);
  padding: clamp(22px, 5vw, 36px);
  border: 1px solid rgba(20, 33, 43, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 24px 80px rgba(25, 42, 55, 0.18);
  backdrop-filter: blur(16px);
}

.topline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 26px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.65);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--off);
}

.dot.online {
  background: var(--on);
  box-shadow: 0 0 0 4px rgba(31, 157, 112, 0.14);
}

.dot.error {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.12);
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 42px 0 32px;
}

h1 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.22em;
  font-size: clamp(2.45rem, 9vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.flag {
  display: inline-block;
  flex: 0 0 auto;
  width: 1.18em;
  height: 0.72em;
  border-radius: 5px;
  background-image: url("data:image/svg+xml,%3Csvg width='120' height='72' viewBox='0 0 120 72' xmlns='http://www.w3.org/2000/svg'%3E%3CclipPath id='r'%3E%3Crect width='120' height='72' rx='7'/%3E%3C/clipPath%3E%3Cg clip-path='url(%23r)'%3E%3Crect width='120' height='24' fill='%23000'/%3E%3Crect y='24' width='120' height='24' fill='%23dd0000'/%3E%3Crect y='48' width='120' height='24' fill='%23ffce00'/%3E%3C/g%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
  forced-color-adjust: none;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.badge {
  flex: 0 0 auto;
  min-width: 96px;
  padding: 10px 14px;
  border-radius: 999px;
  text-align: center;
  color: #fff;
  font-weight: 800;
  background: var(--off);
}

.badge.on {
  background: var(--on);
}

.switch {
  width: 100%;
  display: grid;
  grid-template-columns: 124px 1fr;
  align-items: center;
  gap: 18px;
  min-height: 102px;
  padding: 18px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: #536273;
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, background 160ms ease;
}

.switch:disabled {
  cursor: default;
  opacity: 0.72;
}

.switch:not(:disabled):hover {
  transform: translateY(-1px);
}

.switch.on {
  background: var(--on);
}

.track {
  position: relative;
  display: block;
  width: 112px;
  height: 64px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.thumb {
  position: absolute;
  top: 8px;
  left: 8px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  color: #536273;
  transition: transform 180ms ease, color 180ms ease;
}

.switch.on .thumb {
  color: var(--on);
  transform: translateX(48px);
}

svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.6;
}

.label {
  font-size: clamp(1.3rem, 4vw, 1.85rem);
  font-weight: 850;
  line-height: 1.1;
}

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

.meta div {
  min-height: 74px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
}

.meta span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.meta strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.error {
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(180, 35, 24, 0.25);
  border-radius: 8px;
  color: var(--danger);
  background: rgba(180, 35, 24, 0.07);
}

@media (max-width: 520px) {
  .shell {
    align-items: stretch;
    padding: 14px;
  }

  .panel {
    align-self: center;
  }

  .hero {
    align-items: flex-start;
    flex-direction: column;
    margin-top: 36px;
  }

  .switch {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .meta {
    grid-template-columns: 1fr;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101820;
    --panel: #16222b;
    --ink: #eef5f8;
    --muted: #aab9c5;
    --line: rgba(223, 233, 240, 0.16);
  }

  body {
    background:
      radial-gradient(circle at 78% 12%, rgba(232, 184, 74, 0.18), transparent 28%),
      linear-gradient(135deg, #101820 0%, #182632 48%, #22323d 100%);
  }

  .panel {
    background: rgba(18, 29, 38, 0.86);
    border-color: rgba(255, 255, 255, 0.08);
  }

  .topline,
  .meta div {
    background: rgba(255, 255, 255, 0.05);
  }
}
