:root {
  color-scheme: light;
  --demo-header-height: 98px;
  --navy: #143b55;
  --green: #4a9f4b;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: Arial, sans-serif;
}

.demo-header {
  position: fixed;
  z-index: 10;
  top: 0;
  right: 0;
  left: 0;
  height: var(--demo-header-height);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 4px 18px rgba(11, 34, 49, 0.13);
}

.demo-topbar {
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.55rem clamp(0.75rem, 3vw, 2rem);
  border-bottom: 1px solid #e6edf1;
}

.demo-brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--navy);
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(74, 159, 75, 0.35);
  border-radius: 11px;
  background: #f1f8f2;
  color: var(--green);
  font-size: 1rem;
  font-weight: 800;
}

.demo-brand strong,
.demo-brand small {
  display: block;
}

.demo-brand strong {
  font-size: 0.83rem;
  letter-spacing: 0.06em;
}

.demo-brand small {
  margin-top: 0.12rem;
  color: #738594;
  font-size: 0.57rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.demo-notice {
  flex: 1 1 auto;
  margin: 0;
  color: #536978;
  font-size: 0.82rem;
  text-align: center;
}

.demo-notice strong {
  color: var(--navy);
}

.demo-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.demo-actions a {
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.demo-actions .landing-link {
  padding: 0.62rem 0.8rem;
  border-radius: 7px;
  background: var(--navy);
  color: #fff;
}

.landing-link span {
  color: #a9d8a8;
}

.demo-nav {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  overflow-x: auto;
  padding: 0 clamp(0.5rem, 2.5vw, 1.75rem);
  scrollbar-width: none;
}

.demo-nav::-webkit-scrollbar {
  display: none;
}

.demo-nav a {
  flex: 0 0 auto;
  padding: 0.38rem 0.68rem;
  border-radius: 999px;
  color: #536978;
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.demo-nav a:hover,
.demo-nav a[aria-current="page"] {
  background: #edf5ef;
  color: #2f7e36;
}

.demo-main {
  width: 100%;
  height: 100%;
  padding-top: var(--demo-header-height);
}

#demo-frame {
  width: 100%;
  height: calc(100vh - var(--demo-header-height));
  height: calc(100dvh - var(--demo-header-height));
  display: block;
  border: 0;
  background: #fff;
}

.demo-error {
  padding: 4rem 1.5rem;
  color: var(--navy);
  text-align: center;
}

.demo-error[hidden],
#demo-frame[hidden] {
  display: none;
}

.demo-error a {
  color: var(--green);
  font-weight: 700;
}

.demo-toast {
  position: fixed;
  z-index: 20;
  right: 1rem;
  bottom: 1rem;
  max-width: min(440px, calc(100vw - 2rem));
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: #143b55;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
  color: #fff;
  font-size: 0.88rem;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

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

@media (max-width: 760px) {
  :root {
    --demo-header-height: 108px;
  }

  .demo-topbar {
    min-height: 66px;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .demo-brand {
    gap: 0.4rem;
  }

  .demo-brand strong {
    font-size: 0.73rem;
  }

  .demo-brand small {
    font-size: 0.51rem;
  }

  .demo-notice {
    max-width: 36%;
    font-size: 0.65rem;
    line-height: 1.3;
  }

  .demo-actions {
    gap: 0.4rem;
  }

  .demo-actions a {
    font-size: 0.67rem;
  }

  .demo-actions .landing-link {
    padding: 0.5rem 0.55rem;
  }

  .demo-nav {
    height: 42px;
    padding: 0 0.35rem;
  }

  .demo-nav a {
    padding: 0.36rem 0.55rem;
    font-size: 0.68rem;
  }
}

@media (max-width: 400px) {
  :root {
    --demo-header-height: 118px;
  }

  .demo-notice {
    max-width: 30%;
    font-size: 0.6rem;
  }

  .demo-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
  }

  .demo-actions .landing-link {
    padding: 0;
    background: transparent;
    color: var(--navy);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
