:root {
  color-scheme: light;
  --ink: #111114;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.12);
  --green: #138a3d;
  --yellow: #b77900;
  --red: #d01f2f;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #f5f5f7;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.nav {
  position: fixed;
  top: 12px;
  left: 0;
  right: 0;
  z-index: 10;
  width: min(760px, calc(100% - 28px));
  height: 52px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: transparent;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(18px) saturate(1.18);
}

.brand {
  font-weight: 700;
  letter-spacing: 0;
}

.nav nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #333336;
  font-size: 13px;
  touch-action: none;
  user-select: none;
  cursor: grab;
}

.nav.dragging nav {
  cursor: grabbing;
}

.nav nav a {
  position: relative;
  z-index: 2;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: blur(10px) saturate(1.1);
}

.nav-indicator {
  position: absolute;
  z-index: 1;
  left: 0;
  top: 50%;
  width: 0;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background:
    radial-gradient(circle at var(--glass-x, 45%) var(--glass-y, 30%), rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.055) 48%, rgba(255, 255, 255, 0.015) 78%),
    rgba(255, 255, 255, 0.035);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.32);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, -50%, 0);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), width 0.24s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  backdrop-filter: blur(20px) saturate(1.2);
}

.nav.dragging .nav-indicator {
  transition: none;
}

.nav nav a.nav-selected,
.nav .lang-toggle.nav-selected {
  color: #050506;
}

.lang-toggle {
  position: relative;
  z-index: 2;
  min-width: 38px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: transparent;
  color: #111114;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  backdrop-filter: blur(10px) saturate(1.1);
}

.band {
  min-height: 72vh;
  display: grid;
  place-items: center;
  padding: 88px 22px 54px;
  border-bottom: 12px solid #fff;
}

.band-inner {
  width: min(1120px, 100%);
}

.lead:empty {
  display: none;
}

.band-dark {
  min-height: 88vh;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.58)),
    url("/bg.jpg") center / cover no-repeat;
  text-align: center;
}

.hero .band-inner {
  padding: clamp(22px, 4vw, 44px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
}

.band-light {
  background: linear-gradient(180deg, #fbfbfd 0%, #eeeeef 100%);
}

.band-blue {
  color: #fff;
  background: linear-gradient(135deg, #0a2a43 0%, #176f86 52%, #37a67b 100%);
}

.band-white {
  background: #fff;
}

.eyebrow {
  margin: 0 0 12px;
  color: inherit;
  font-size: 17px;
  font-weight: 700;
  opacity: 0.78;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.04;
}

h1 {
  max-width: 920px;
  margin-inline: auto;
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 800;
}

h2 {
  font-size: clamp(38px, 6vw, 72px);
  font-weight: 800;
}

.lead {
  max-width: 740px;
  margin: 18px auto 0;
  color: currentColor;
  font-size: clamp(19px, 2.4vw, 27px);
  line-height: 1.35;
  opacity: 0.74;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.time-strip,
.server-strip {
  width: min(820px, 100%);
  display: grid;
  gap: 10px;
  margin: 24px auto 0;
}

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

.server-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(680px, 100%);
  margin-top: 10px;
}

.time-strip div,
.server-strip div {
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(18px);
}

.time-strip span,
.server-strip span {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.72;
}

.time-strip strong,
.server-strip strong {
  overflow-wrap: anywhere;
  font-size: clamp(18px, 2.3vw, 26px);
  line-height: 1.05;
}

.usage-card {
  align-items: stretch;
}

.usage-card strong {
  text-align: left;
}

.usage-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.usage-bar i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  transition: width 0.45s ease;
}

.usage-cpu .usage-bar i {
  background: linear-gradient(90deg, #38d6ff, #007aff);
}

.usage-ram .usage-bar i {
  background: linear-gradient(90deg, #7ee787, #30d158);
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.1);
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(18px) saturate(1.24);
}

.button.primary {
  border-color: rgba(120, 190, 255, 0.36);
  background:
    linear-gradient(135deg, rgba(0, 113, 227, 0.24), rgba(255, 255, 255, 0.06)),
    rgba(0, 113, 227, 0.1);
  color: #fff;
}

.band-white .button,
.band-light .button {
  border-color: rgba(0, 0, 0, 0.16);
  background: #fff;
}

.band-white .button.primary,
.band-light .button.primary {
  background:
    linear-gradient(135deg, rgba(0, 113, 227, 0.24), rgba(255, 255, 255, 0.08)),
    rgba(0, 113, 227, 0.1);
  color: #fff;
}

.status-layout {
  display: grid;
  grid-template-columns: 0.86fr 1.14fr;
  gap: 22px;
  margin-top: 34px;
}

.status-main,
.metric,
.message-form,
.message-list {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(20px);
}

.status-main {
  min-height: 284px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px;
}

.state {
  font-size: clamp(52px, 8vw, 96px);
  line-height: 1;
  font-weight: 850;
}

.state-normal {
  color: var(--green);
}

.state-warning {
  color: var(--yellow);
}

.state-fault {
  color: var(--red);
}

.state-loading {
  color: #707076;
}

.status-copy {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.42;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  min-height: 135px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
}

.metric span {
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
}

.metric strong {
  overflow-wrap: anywhere;
  font-size: clamp(28px, 4.4vw, 52px);
  line-height: 1.02;
}

.metric strong.ok {
  color: var(--green);
}

.metric strong.bad {
  color: var(--red);
}

.fineprint,
.notice,
#byteCount {
  color: var(--muted);
  font-size: 13px;
}

.fineprint {
  margin: 16px 0 0;
}

.split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.split .lead {
  margin-left: 0;
}

.about-scroll {
  max-width: 760px;
  max-height: 220px;
  margin-top: 20px;
  overflow: auto;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: #333336;
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;
  backdrop-filter: blur(16px);
}

.message-form {
  margin-top: 28px;
  padding: 18px;
}

textarea {
  width: 100%;
  min-height: 116px;
  resize: vertical;
  border: 1px solid var(--line);
  padding: 15px 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  font: inherit;
  font-size: 18px;
  line-height: 1.4;
  outline: none;
}

textarea:focus {
  border-color: #0071e3;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.16);
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.notice {
  min-height: 18px;
  margin: 10px 0 0;
}

.notice.error {
  color: var(--red);
}

.message-list {
  max-height: 420px;
  margin-top: 18px;
  overflow: auto;
}

.message-item {
  display: grid;
  gap: 7px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.message-item:last-child {
  border-bottom: 0;
}

.message-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 17px;
  line-height: 1.42;
}

.message-meta {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 760px) {
  .nav {
    top: auto;
    bottom: max(10px, env(safe-area-inset-bottom));
    width: min(430px, calc(100% - 20px));
    height: 62px;
    padding: 0 8px;
  }

  .nav nav {
    width: 100%;
    justify-content: space-between;
    gap: 4px;
    font-size: 12px;
  }

  .brand {
    display: none;
  }

  .nav nav a,
  .lang-toggle {
    min-width: 0;
    min-height: 46px;
    flex: 1;
    justify-content: center;
    padding: 0 8px;
    background: transparent;
  }

  .nav-indicator {
    height: 46px;
  }

  .nav nav a[href="/files/"] {
    display: none;
  }

  .band {
    min-height: auto;
    padding: 74px 14px 38px;
    border-bottom-width: 8px;
  }

  .band-dark {
    min-height: 86vh;
  }

  h1 {
    font-size: 52px;
  }

  h2 {
    font-size: 40px;
  }

  .lead {
    font-size: 20px;
  }

  .hero-actions,
  .form-row,
  .split {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
    min-height: 52px;
  }

  .time-strip,
  .server-strip {
    grid-template-columns: 1fr;
    margin-top: 18px;
  }

  .server-strip {
    margin-top: 10px;
  }

  .time-strip div,
  .server-strip div {
    min-height: 70px;
  }

  .about-scroll {
    max-height: 42vh;
    font-size: 14px;
  }

  body {
    padding-bottom: 74px;
  }

  .status-layout,
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .status-main,
  .metric,
  .message-form {
    padding: 18px;
  }

  .status-main {
    min-height: 220px;
  }

  .state {
    font-size: 58px;
  }

  .status-copy {
    font-size: 17px;
  }

  .metric {
    min-height: 118px;
  }

  .metric strong {
    font-size: 38px;
  }

  .message-list {
    max-height: 54vh;
  }
}
