* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: #0f1117;
  color: #e9e9ef;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.demo-layout {
  display: flex;
  min-height: calc(100vh - 72px);
  width: 100vw;
}

.demo-frame-wrapper {
  min-width: 0;
  flex: 1;
  background: #11131b;
}

.demo-frame-wrapper iframe {
  display: block;
  width: 100%;
  height: calc(100vh - 72px);
  border: 0;
}

.demo-limit-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: #0f1117;
  padding: 24px;
}

.demo-limit-screen[hidden] {
  display: none;
}

.demo-limit-card {
  width: min(520px, 100%);
  border: 1px solid #343847;
  border-radius: 8px;
  background: #1a1d27;
  box-shadow: 0 24px 80px rgb(0 0 0 / 42%);
  padding: 28px;
  text-align: center;
}

.demo-limit-card h2 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 1.45rem;
  line-height: 1.25;
}

.demo-limit-card p {
  margin: 0;
  color: #c9c9d4;
  font-size: 1rem;
  line-height: 1.55;
}

.demo-limit-card a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
  border-radius: 7px;
  background: #ff5e1f;
  padding: 0 18px;
  color: #fff;
  font-weight: 750;
  text-decoration: none;
}

.demo-controls {
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 18px;
  border-top: 1px solid #2a2d3a;
  background: #1a1d27;
  padding: 12px 18px;
}

.demo-brand {
  min-width: 150px;
}

.demo-kicker {
  margin: 0 0 4px;
  color: #808291;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.demo-brand h1 {
  margin: 0;
  color: #ff5e1f;
  font-size: 1.15rem;
  font-weight: 750;
}

.demo-status {
  min-width: 0;
  flex: 1;
  margin: 0;
  color: #c9c9d4;
  font-size: 0.88rem;
  line-height: 1.45;
}

.demo-run-counter {
  flex: 0 0 auto;
  margin: 0;
  border: 1px solid #343847;
  border-radius: 999px;
  background: #11131b;
  padding: 8px 12px;
  color: #f2c58a;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.demo-run-counter[hidden] {
  display: none;
}

.demo-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.demo-btn {
  min-height: 40px;
  min-width: 132px;
  border: 0;
  border-radius: 7px;
  background: #ff5e1f;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 750;
  transition: filter 0.18s ease, opacity 0.18s ease;
}

.demo-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.demo-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.demo-btn.secondary {
  background: #2a2d3a;
  color: #c7c8d3;
}

.demo-log {
  display: none;
}

.demo-log div + div {
  margin-top: 5px;
}

@media (max-width: 720px) {
  .demo-layout,
  .demo-frame-wrapper iframe {
    min-height: calc(100vh - 132px);
    height: calc(100vh - 132px);
  }

  .demo-controls {
    min-height: 132px;
    flex-wrap: wrap;
    gap: 10px 14px;
  }

  .demo-brand {
    min-width: 120px;
  }

  .demo-status {
    flex-basis: calc(100% - 140px);
    font-size: 0.82rem;
  }

  .demo-run-counter {
    order: 3;
    flex-basis: 100%;
    text-align: center;
    white-space: normal;
  }

  .demo-actions {
    width: 100%;
  }

  .demo-btn {
    flex: 1;
    min-width: 0;
  }
}

.varpu-mermaid-error {
  display: none !important;
}
