.stats {
  grid-template-columns: repeat(6, minmax(150px, 1fr));
}

.refresh-shell {
  position: relative;
  align-self: center;
}

.refresh-control {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 9px 13px;
  border: 1px solid rgba(100, 130, 175, .25);
  border-radius: 999px;
  color: #b7c6dd;
  background: linear-gradient(145deg, rgba(24, 36, 58, .9), rgba(10, 17, 29, .96));
  box-shadow: 0 10px 32px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .04);
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  cursor: pointer;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease, color .2s ease;
}

.refresh-control:hover,
.refresh-control[aria-expanded="true"] {
  transform: translateY(-1px);
  color: var(--text);
  border-color: rgba(25, 199, 255, .5);
  box-shadow: 0 14px 38px rgba(0, 0, 0, .28), 0 0 24px rgba(25, 199, 255, .1);
}

.refresh-control:focus-visible,
.refresh-options button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.refresh-control.is-live {
  color: var(--green);
  border-color: rgba(80, 227, 164, .18);
}

.refresh-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px rgba(25, 199, 255, .75);
}

.refresh-control.is-live .refresh-dot {
  background: var(--green);
  box-shadow: 0 0 16px var(--green);
}

.refresh-control.is-live .refresh-dot::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(80, 227, 164, .55);
  border-radius: inherit;
  animation: live-pulse 1.8s ease-out infinite;
}

.refresh-chevron {
  width: 6px;
  height: 6px;
  margin-left: 2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: .65;
  transition: transform .2s ease;
}

.refresh-control[aria-expanded="true"] .refresh-chevron {
  transform: rotate(225deg) translate(-1px, -1px);
}

.refresh-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 12px);
  right: 0;
  width: 310px;
  padding: 16px;
  border: 1px solid rgba(72, 101, 145, .42);
  border-radius: 16px;
  color: var(--text);
  background: linear-gradient(155deg, rgba(22, 32, 51, .99), rgba(8, 13, 23, .99));
  box-shadow: 0 28px 70px rgba(0, 0, 0, .48), inset 0 1px 0 rgba(255, 255, 255, .05);
  backdrop-filter: blur(18px);
}

.refresh-popover::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 24px;
  width: 9px;
  height: 9px;
  border-top: 1px solid rgba(72, 101, 145, .42);
  border-left: 1px solid rgba(72, 101, 145, .42);
  background: #151f32;
  transform: rotate(45deg);
}

.refresh-popover-head {
  display: grid;
  gap: 4px;
  margin-bottom: 13px;
}

.refresh-popover-head strong {
  font-size: 13px;
}

.refresh-popover-head span,
.refresh-popover p {
  color: var(--muted);
  font-size: 10px;
}

.refresh-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.refresh-options button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #b7c6dd;
  background: rgba(8, 13, 23, .65);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.refresh-options button:hover {
  color: var(--text);
  border-color: rgba(25, 199, 255, .45);
  transform: translateY(-1px);
}

.refresh-options button.active {
  color: #071019;
  border-color: transparent;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  box-shadow: 0 8px 24px rgba(25, 199, 255, .18);
}

.refresh-popover p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 12px 0 0;
}

.refresh-popover p span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}

@keyframes live-pulse {
  from { opacity: .7; transform: scale(.65); }
  to { opacity: 0; transform: scale(1.5); }
}

.session-main {
  flex: 1;
  min-width: 0;
}

.session-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 12px;
}

.session-poster {
  display: block;
  width: 96px;
  height: 144px;
  border-radius: 10px;
  object-fit: cover;
  background: #0a101c;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .3);
}

.session-poster.placeholder {
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .45);
  font-size: 28px;
  font-weight: 900;
  background: linear-gradient(145deg, #1d2b43, #0a101c);
}

.session-card p {
  margin-top: 8px;
}

.playback-progress {
  width: min(520px, 100%);
  margin-top: 12px;
}

.playback-progress > div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
}

.playback-progress strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.playback-progress progress {
  display: block;
  width: 100%;
}

.stream-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

.stream-grid strong {
  margin-left: 4px;
  color: var(--text);
}

progress {
  appearance: none;
  -webkit-appearance: none;
  overflow: hidden;
  height: 7px;
  border: 0;
  border-radius: 99px;
  background: #283149;
}

progress::-webkit-progress-bar {
  border-radius: 99px;
  background: #283149;
}

progress::-webkit-progress-value {
  border-radius: 99px;
  background: linear-gradient(90deg, var(--green), var(--cyan));
}

progress::-moz-progress-bar {
  border-radius: 99px;
  background: linear-gradient(90deg, var(--green), var(--cyan));
}

progress.meter {
  display: inline-block;
  width: 180px;
  margin-right: 10px;
  vertical-align: middle;
}

progress.meter.large {
  display: block;
  width: 100%;
  height: 9px;
}

progress.meter.warning::-webkit-progress-value { background: var(--yellow); }
progress.meter.warning::-moz-progress-bar { background: var(--yellow); }
progress.meter.critical::-webkit-progress-value { background: var(--red); }
progress.meter.critical::-moz-progress-bar { background: var(--red); }

.core-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 18px;
  margin: 16px 0 22px;
}

.core-row,
.engine-row {
  display: grid;
  grid-template-columns: 52px 1fr 42px;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.core-row progress,
.engine-row progress {
  width: 100%;
}

.core-row strong,
.engine-row strong {
  text-align: right;
  color: var(--text);
}

.engine-row { margin: 11px 0; }
.load-title {
  margin-top: 24px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .12em;
}

.load-row strong {
  transition: color .2s ease, text-shadow .2s ease;
}

.load-row .load-good {
  color: var(--green);
  text-shadow: 0 0 16px rgba(80, 227, 164, .24);
}

.load-row .load-warning {
  color: var(--yellow);
  text-shadow: 0 0 16px rgba(255, 200, 87, .24);
}

.load-row .load-danger {
  color: var(--red);
  text-shadow: 0 0 16px rgba(255, 102, 122, .28);
}

.bad { color: var(--red) !important; }

.admin-server {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.admin-server-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.admin-server-head h3 {
  margin: 4px 0 0;
  font-size: 16px;
}

.service-summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-size: 10px;
  letter-spacing: .08em;
  white-space: nowrap;
}

.service-summary i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(80, 227, 164, .8);
}

.service-summary.has-issue { color: var(--red); }
.service-summary.has-issue i {
  background: var(--red);
  box-shadow: 0 0 12px rgba(255, 102, 122, .8);
}

.server-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.server-fact {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(37, 50, 74, .8);
  border-radius: 11px;
  background: rgba(8, 13, 23, .35);
}

.server-fact-wide { grid-column: 1 / -1; }
.server-fact span,
.server-fact small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .08em;
}

.server-fact strong {
  display: block;
  margin: 5px 0 3px;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.35;
}

.server-fact a { color: var(--cyan); }
.server-fact a:hover { text-decoration: underline; }

.cpu-fact,
.gpu-fact {
  display: flex;
  flex-direction: column;
}

.cpu-fact-main,
.gpu-fact-main { display: block; }

.cpu-fact-main > strong { margin-bottom: 5px; }

.cpu-fact-live {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 11px;
}

.cpu-fact-live span {
  min-width: 0;
  padding: 5px 3px;
  border: 1px solid rgba(25, 199, 255, .18);
  border-radius: 7px;
  background: rgba(25, 199, 255, .06);
  font-size: 8px;
  text-align: center;
  white-space: nowrap;
}

.cpu-fact-live span.is-total {
  border-color: rgba(80, 227, 164, .28);
  background: rgba(80, 227, 164, .07);
}

.cpu-fact-live b {
  margin-left: 3px;
  color: var(--cyan);
  font-size: 10px;
}

.cpu-fact-live .is-total b { color: var(--green); }

.gpu-fact-main > strong { margin-bottom: 5px; }

.gpu-fact-live {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
  margin-top: 11px;
}

.gpu-fact-live span {
  padding: 5px 7px;
  border: 1px solid rgba(25, 199, 255, .18);
  border-radius: 7px;
  background: rgba(25, 199, 255, .06);
  font-size: 8px;
  white-space: nowrap;
}

.gpu-fact-live b {
  margin-left: 3px;
  color: var(--cyan);
  font-size: 10px;
}

.update-fact {
  position: relative;
  overflow: hidden;
}

.update-fact::after {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  content: "";
}

.update-fact.is-current {
  border-color: rgba(80, 227, 164, .28);
  background: rgba(80, 227, 164, .05);
}

.update-fact.is-current strong { color: var(--green); }
.update-fact.is-current::after {
  background: var(--green);
  box-shadow: 0 0 11px rgba(80, 227, 164, .7);
}

.update-fact.is-available {
  border-color: rgba(255, 200, 87, .35);
  background: rgba(255, 200, 87, .07);
}

.update-fact.is-available strong { color: var(--yellow); }
.update-fact.is-available::after {
  background: var(--yellow);
  box-shadow: 0 0 11px rgba(255, 200, 87, .65);
}

.update-fact.is-unknown strong { color: var(--muted); }
.update-fact.is-unknown::after { background: var(--muted); }

@media (max-width: 1250px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 600px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .core-grid { grid-template-columns: 1fr; }
  progress.meter { width: 110px; }
  .session-card {
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: start;
    gap: 13px;
  }
  .session-poster {
    width: 72px;
    height: 108px;
  }
  .session-card .pill {
    grid-column: 2;
    justify-self: start;
  }
  .stream-grid { gap: 6px 10px; }
  .refresh-shell { align-self: flex-end; }
  .refresh-popover {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: 18px;
    left: 12px;
    width: auto;
  }
  .refresh-popover::before { display: none; }
  .server-facts { grid-template-columns: 1fr; }
  .server-fact-wide { grid-column: auto; }
  .gpu-fact-live { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .refresh-control.is-live .refresh-dot::after { animation: none; }
}
