.wrm-earth-page .pt-site-main {
  overflow: hidden;
  background: var(--pt-bg);
}

.wrm-earth {
  display: grid;
  min-width: 0;
  min-height: calc(100dvh - var(--pt-admin-offset));
  grid-template-rows: 48px minmax(0, 1fr);
  color: var(--pt-text);
  background: var(--pt-bg);
}

.wrm-earth__bar {
  position: relative;
  z-index: 2;
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 12px 6px 16px;
  border-bottom: 1px solid var(--pt-border);
  background: var(--pt-surface);
}

.wrm-earth__identity,
.wrm-earth__actions {
  display: flex;
  min-width: 0;
  align-items: center;
}

.wrm-earth__identity {
  gap: 10px;
}

.wrm-earth__identity > i {
  color: var(--pt-accent);
  font-size: 21px;
}

.wrm-earth__identity h1 {
  margin: 0;
  color: var(--pt-text);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.1;
}

.wrm-earth__identity span {
  display: block;
  margin-top: 2px;
  color: var(--pt-muted);
  font-size: 11px;
  line-height: 1;
}

.wrm-earth__actions {
  gap: 4px;
}

.wrm-earth__actions button,
.wrm-earth__actions a {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--pt-text);
  background: transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}

.wrm-earth__actions button:hover,
.wrm-earth__actions a:hover {
  border-color: var(--pt-soft-border);
  color: var(--pt-text);
  background: var(--pt-surface-2);
}

.wrm-earth__actions button:active,
.wrm-earth__actions a:active {
  transform: translateY(1px);
}

.wrm-earth__actions i {
  font-size: 18px;
}

.wrm-earth__actions [data-wrm-cast][aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--pt-accent) 48%, transparent);
  color: var(--pt-accent);
  background: color-mix(in srgb, var(--pt-accent) 12%, transparent);
}

.wrm-earth__cast-status {
  position: absolute;
  z-index: 3;
  top: calc(100% + 8px);
  right: 10px;
  width: min(330px, calc(100vw - 24px));
  margin: 0;
  padding: 9px 11px;
  border: 1px solid var(--pt-soft-border);
  border-radius: 10px;
  color: var(--pt-text);
  background: var(--pt-surface);
  box-shadow: 0 10px 30px rgb(0 0 0 / 18%);
  font-size: 12px;
  line-height: 1.45;
}

.wrm-earth__cast-status[hidden] {
  display: none;
}

.wrm-earth__viewport {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #090c0a;
}

.wrm-earth__viewport iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #090c0a;
}

.wrm-earth__loading {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: #dce8df;
  background: #090c0a;
  transition: opacity .24s ease, visibility .24s ease;
}

.wrm-earth__loading i {
  color: #6f946f;
  font-size: 30px;
  animation: wrm-earth-turn 3.4s linear infinite;
}

.wrm-earth__loading span {
  font-size: 13px;
}

.wrm-earth__viewport.is-ready .wrm-earth__loading {
  visibility: hidden;
  opacity: 0;
}

.wrm-earth__setup {
  display: grid;
  width: min(680px, calc(100% - 36px));
  grid-template-columns: 52px minmax(0, 1fr);
  align-self: center;
  justify-self: center;
  gap: 20px;
  padding: 26px 0;
  border-top: 1px solid var(--pt-border);
  border-bottom: 1px solid var(--pt-border);
}

.wrm-earth__setup-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid var(--pt-soft-border);
  border-radius: 14px;
  color: var(--pt-accent);
  background: var(--pt-surface);
}

.wrm-earth__setup-icon i {
  font-size: 24px;
}

.wrm-earth__setup h2 {
  margin: 0;
  color: var(--pt-text);
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.18;
}

.wrm-earth__setup p {
  max-width: 54ch;
  margin: 8px 0 18px;
  color: var(--pt-muted);
  line-height: 1.6;
}

.wrm-earth__configure,
.wrm-earth__waiting {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  color: var(--pt-text);
  font-size: 13px;
  font-weight: 600;
}

.wrm-earth__configure {
  padding: 0 13px;
  border: 1px solid var(--pt-accent);
  border-radius: 10px;
  background: var(--pt-accent);
  color: var(--pt-accent-contrast, #071008);
  text-decoration: none;
}

.wrm-earth__configure:hover {
  color: var(--pt-accent-contrast, #071008);
  filter: brightness(1.05);
}

.wrm-earth__waiting {
  color: var(--pt-muted);
}

@keyframes wrm-earth-turn {
  to { transform: rotate(360deg); }
}

@media (max-width: 767px) {
  .wrm-earth {
    min-height: calc(100dvh - var(--pt-admin-offset) - var(--pt-mobile-header) - var(--pt-mobile-footer) - env(safe-area-inset-bottom));
  }

  .wrm-earth__bar {
    padding-inline: 10px 7px;
  }

  .wrm-earth__identity span {
    display: none;
  }

  .wrm-earth__setup {
    width: calc(100% - 32px);
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wrm-earth__loading i {
    animation: none;
  }

  .wrm-earth__actions button,
  .wrm-earth__actions a,
  .wrm-earth__loading {
    transition: none;
  }
}
