* {
  box-sizing: border-box;
}

:root {
  font-family: Inter, Arial, sans-serif;
  color: #111827;
  background: #f4f7fb;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(74, 144, 226, 0.12), transparent 30%),
    linear-gradient(180deg, #f8fbff 0%, #eef3f9 100%);
}

button,
iframe {
  font: inherit;
}

.app {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.toolbar {
  min-height: 72px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border-radius: 14px;
  font-size: 1.1rem;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 1rem;
}

.brand-text span {
  margin-top: 4px;
  color: #6b7280;
  font-size: 0.82rem;
}

.fullscreen-button {
  padding: 10px 16px;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

.fullscreen-button:hover {
  transform: translateY(-1px);
  filter: brightness(0.98);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.fullscreen-button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.25);
  outline-offset: 3px;
}

.prototype-wrapper {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 14px;
}

.prototype-wrapper iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.14);
}

.loader {
  position: absolute;
  inset: 14px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #ffffff;
  border-radius: 18px;
  transition:
    opacity 240ms ease,
    visibility 240ms ease;
}

.loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader p {
  margin: 0;
  color: #5f6b7a;
  font-size: 0.95rem;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(37, 99, 235, 0.14);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.prototype-wrapper:fullscreen {
  padding: 0;
  background: #ffffff;
}

.prototype-wrapper:fullscreen iframe {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.prototype-wrapper:fullscreen .loader {
  inset: 0;
  border-radius: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 640px) {
  .toolbar {
    min-height: 60px;
    padding: 9px 12px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .brand-text span {
    display: none;
  }

  .fullscreen-button {
    padding: 9px 13px;
    font-size: 0.88rem;
  }

  .prototype-wrapper {
    padding: 8px;
  }

  .prototype-wrapper iframe,
  .loader {
    border-radius: 12px;
  }

  .loader {
    inset: 8px;
  }
}
