body:has(.security-dialog[open]) {
  overflow: hidden;
}

.demo-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid rgba(33, 38, 49, 0.8);
  background: rgba(8, 11, 18, 0.82);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  padding: 0.9rem clamp(1rem, 4vw, 3rem);
}

.demo-logo {
  font-size: 0.82rem;
  letter-spacing: 0.15em;
  text-decoration: none;
  text-transform: uppercase;
}

.demo-logo span {
  color: var(--rm-gold);
}

.demo-header nav {
  display: flex;
  gap: 1.5rem;
}

.demo-header nav a {
  color: var(--rm-muted);
  font-size: 0.82rem;
  text-decoration: none;
}

.demo-badge {
  justify-self: end;
  border: 1px solid rgba(240, 66, 124, 0.4);
  border-radius: 999px;
  color: var(--rm-pink);
  font-family: "Orbitron", monospace;
  font-size: 0.52rem;
  letter-spacing: 0.13em;
  padding: 0.35rem 0.7rem;
  text-transform: uppercase;
}

.demo-main {
  width: min(100% - 2rem, 1180px);
  margin-inline: auto;
  padding: 3.5rem 0;
}

.demo-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}

.demo-kicker {
  color: var(--rm-green);
  font-family: "Orbitron", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.demo-intro h1 {
  margin: 0.75rem 0 0.7rem;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
  text-transform: uppercase;
}

.demo-intro h1 span {
  color: var(--rm-gold);
}

.demo-intro p {
  max-width: 620px;
  color: var(--rm-muted);
  font-size: 1.05rem;
}

.demo-online {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--rm-green);
  font-family: "Orbitron", monospace;
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.demo-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 2.6rem 0;
  overflow: hidden;
  border: 1px solid var(--rm-line);
  border-radius: var(--rm-radius);
  background: rgba(17, 23, 34, 0.82);
}

.demo-stats article {
  display: flex;
  min-height: 96px;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--rm-line);
  padding: 1rem 1.3rem;
}

.demo-stats article:last-child {
  border-right: 0;
}

.demo-stats span,
.demo-stats small {
  color: var(--rm-muted);
}

.demo-stats span {
  font-family: "Orbitron", monospace;
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.demo-stats strong {
  color: var(--rm-green);
  font-family: "Orbitron", monospace;
  font-size: 1rem;
  line-height: 1.4;
}

.demo-stats small {
  font-size: 0.75rem;
}

.table-section__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.table-section__heading h2 {
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table-section__heading span {
  color: var(--rm-green);
}

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

.table-card {
  overflow: hidden;
  border: 1px solid var(--rm-line);
  border-radius: 10px;
  background: rgba(17, 23, 34, 0.88);
  color: var(--rm-text);
  cursor: pointer;
  padding: 0;
  text-align: left;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.table-card:hover,
.table-card.is-selected {
  transform: translateY(-4px);
  border-color: rgba(31, 173, 126, 0.5);
}

.table-card__visual {
  display: block;
  height: 124px;
  border-bottom: 1px solid var(--rm-line);
  background-color: #171b24;
  background-position: center;
  background-size: cover;
}

.visual-a { background-image: radial-gradient(circle at 65% 45%, #ca2539 0 11%, transparent 12%), linear-gradient(135deg, #372019, #0c0d12 65%); }
.visual-b { background-image: radial-gradient(circle at 48% 55%, #ed4d38 0 18%, transparent 19%), repeating-conic-gradient(from 10deg at 48% 55%, #171717 0 10deg, #7a101b 10deg 20deg); }
.visual-c { background-image: radial-gradient(circle at 50% 52%, #b98b2d 0 12%, transparent 13%), repeating-conic-gradient(from 5deg at 50% 52%, #121212 0 10deg, #7b151f 10deg 20deg); }
.visual-d { background-image: linear-gradient(120deg, rgba(231, 39, 68, 0.7), transparent 45%), radial-gradient(circle at 70% 35%, #ddba3e, #1a1710 20%, #080b12 55%); }

.table-card strong,
.table-card small {
  display: block;
  padding-inline: 0.9rem;
}

.table-card strong {
  padding-top: 0.8rem;
  font-family: "Orbitron", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.table-card small {
  padding-top: 0.25rem;
  padding-bottom: 0.9rem;
  color: var(--rm-muted);
}

.analysis-panel {
  margin-top: 2rem;
}

.analysis-panel__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--rm-line);
  padding: 1.25rem;
}

.analysis-panel__top > div > span {
  color: var(--rm-pink);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.analysis-panel__top h2 {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.analysis-lock {
  border: 1px solid rgba(255, 198, 26, 0.35);
  border-radius: 999px;
  color: var(--rm-gold);
  font-size: 0.72rem;
  padding: 0.35rem 0.75rem;
}

.analysis-panel__body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1rem;
  padding: 1.25rem;
}

.analysis-placeholder {
  display: grid;
  min-height: 180px;
  place-content: center;
  color: var(--rm-muted);
  text-align: center;
}

.analysis-placeholder span {
  color: var(--rm-green);
  font-size: 2rem;
}

.analysis-placeholder p {
  margin-top: 0.5rem;
}

.analysis-panel aside {
  border: 1px solid rgba(255, 198, 26, 0.2);
  border-radius: 8px;
  background: rgba(255, 198, 26, 0.05);
  padding: 1rem;
}

.analysis-panel aside strong {
  color: var(--rm-gold);
  font-family: "Orbitron", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.analysis-panel aside p {
  margin-top: 0.5rem;
  color: rgba(239, 237, 231, 0.75);
  font-size: 0.85rem;
}

.security-dialog {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 100;
  width: min(calc(100% - 2rem), 480px);
  transform: translate(-50%, -50%);
  border: 1px solid rgba(31, 173, 126, 0.24);
  border-radius: 14px;
  background: linear-gradient(145deg, #161d29, #0f141e);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  color: var(--rm-text);
  padding: 2rem;
}

.security-dialog::backdrop {
  background: transparent;
}

.security-dialog__close {
  position: absolute;
  top: -13px;
  right: -13px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #e6433f;
  color: white;
  cursor: pointer;
  font-size: 1.3rem;
  box-shadow: 0 0 16px rgba(230, 67, 63, 0.48);
}

.security-dialog__icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 198, 26, 0.25);
  border-radius: 8px;
  background: rgba(255, 198, 26, 0.1);
  color: var(--rm-gold);
}

.security-dialog h2 {
  margin: -2.1rem 0 1.4rem 3.4rem;
  font-size: 0.95rem;
}

.security-dialog p {
  margin-top: 0.8rem;
  color: rgba(137, 210, 180, 0.78);
}

.security-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(4, 7, 11, 0.78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

body:not(:has(.security-dialog[open])) .dialog-backdrop {
  display: none;
}

.demo-toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  max-width: 340px;
  transform: translateY(140%);
  border: 1px solid rgba(31, 173, 126, 0.35);
  border-radius: 8px;
  background: #121923;
  color: var(--rm-muted);
  padding: 0.9rem 1rem;
  transition: transform 0.25s ease;
}

.demo-toast.is-visible {
  transform: translateY(0);
}

@media (max-width: 800px) {
  .demo-header {
    grid-template-columns: 1fr auto;
  }

  .demo-header nav {
    display: none;
  }

  .demo-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .demo-stats,
  .table-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .demo-stats article:nth-child(2) {
    border-right: 0;
  }

  .demo-stats article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--rm-line);
  }

  .analysis-panel__body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  .demo-main {
    padding-top: 2.3rem;
  }

  .demo-stats,
  .table-grid {
    grid-template-columns: 1fr;
  }

  .demo-stats article,
  .demo-stats article:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--rm-line);
  }

  .demo-stats article:last-child {
    border-bottom: 0;
  }

  .security-dialog {
    padding: 1.5rem;
  }

  .security-dialog h2 {
    margin-left: 3.2rem;
  }
}
