:root {
  --ink: #112451;
  --ink-soft: #253b69;
  --aqua: #08e6c3;
  --aqua-dark: #00bfa6;
  --paper: #f4f6f8;
  --white: #ffffff;
  --muted: #6c768a;
  --line: #dce1e8;
  --danger: #d7584f;
  --header-height: 78px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", sans-serif;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, rgb(17 36 81 / 0.035) 1px, transparent 1px),
    linear-gradient(rgb(17 36 81 / 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: auto minmax(280px, 720px) auto;
  align-items: center;
  gap: 28px;
  min-height: var(--header-height);
  padding: 14px clamp(20px, 4vw, 64px);
  color: var(--white);
  background: var(--ink);
  box-shadow: 0 8px 24px rgb(17 36 81 / 0.15);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 112px;
  height: auto;
}

.brand-divider {
  width: 1px;
  height: 27px;
  background: rgb(255 255 255 / 0.26);
}

.product-name {
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
  font-weight: 600;
}

.url-form {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  min-width: 0;
  height: 48px;
  padding: 4px;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: 6px;
  background: rgb(255 255 255 / 0.1);
}

.url-prefix {
  padding: 0 12px;
  color: var(--aqua);
  font-family: "Space Grotesk", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

.url-form input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  color: var(--white);
  background: transparent;
}

.url-form input::placeholder {
  color: rgb(255 255 255 / 0.48);
}

.primary-button {
  height: 38px;
  padding: 0 19px;
  border: 0;
  border-radius: 4px;
  color: var(--ink);
  font-weight: 700;
  background: var(--aqua);
}

.primary-button:hover {
  background: #3cf0d4;
}

.header-actions,
.device-actions {
  display: flex;
  gap: 8px;
}

.icon-button,
.frame-action {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 0.2);
  border-radius: 4px;
  color: var(--white);
  background: transparent;
}

.icon-button:hover {
  border-color: var(--aqua);
  color: var(--aqua);
}

button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentcolor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

main {
  width: min(1720px, 100%);
  margin: 0 auto;
  padding: 48px clamp(20px, 4vw, 64px) 80px;
}

.intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 36px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--aqua-dark);
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  max-width: 720px;
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(32px, 4vw, 58px);
  line-height: 0.98;
  letter-spacing: 0;
}

.intro-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 5px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.intro-meta p {
  max-width: 320px;
  margin: 0 15px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--aqua-dark);
}

.notice {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin: -12px 0 28px;
  padding: 13px 16px;
  border-left: 3px solid var(--aqua-dark);
  color: var(--ink-soft);
  font-size: 13px;
  background: #e7faf7;
}

.notice[hidden] {
  display: none;
}

.notice svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentcolor;
  stroke-width: 1.8;
}

.notice p {
  margin: 0;
}

.notice button {
  border: 0;
  color: inherit;
  font-size: 22px;
  line-height: 1;
  background: transparent;
}

.device-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.device-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  box-shadow: 0 12px 40px rgb(17 36 81 / 0.06);
}

.device-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.device-header h2 {
  margin: 0 0 3px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 15px;
  line-height: 1.2;
}

.device-spec {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.frame-action {
  width: 34px;
  height: 34px;
  border-color: var(--line);
  color: var(--muted);
}

.frame-action:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.frame-action svg {
  width: 16px;
  height: 16px;
}

.stage {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  padding: 34px 24px 42px;
  background:
    radial-gradient(circle at center, rgb(8 230 195 / 0.08), transparent 50%),
    #eef1f4;
}

.browser-frame {
  position: absolute;
  top: 34px;
  left: 50%;
  overflow: hidden;
  border: 1px solid #bac2cf;
  border-radius: 7px;
  background: var(--white);
  box-shadow: 0 16px 32px rgb(17 36 81 / 0.14);
  transform-origin: top center;
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 9px;
  border-bottom: 1px solid #cfd5dd;
  background: #e4e7eb;
}

.browser-bar > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a5adba;
}

.browser-bar > span:first-child {
  background: #eb746c;
}

.browser-address {
  width: 42%;
  height: 9px;
  margin-left: 5px;
  border-radius: 2px;
  background: rgb(255 255 255 / 0.78);
}

.viewport-shell {
  position: relative;
  overflow: hidden;
  background: var(--white);
}

.viewport {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--white);
}

.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
  background: var(--white);
}

.empty-state img {
  width: 90px;
  opacity: 0.28;
}

.device-card.is-loaded .empty-state {
  display: none;
}

.toast {
  position: fixed;
  z-index: 30;
  right: 24px;
  bottom: 24px;
  padding: 12px 16px;
  border-radius: 4px;
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  background: var(--ink);
  box-shadow: 0 10px 30px rgb(17 36 81 / 0.24);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

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

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .url-form {
    grid-column: 1 / -1;
    grid-row: 2;
  }

}

@media (max-width: 620px) {
  .topbar {
    padding: 12px 16px;
  }

  .brand img {
    width: 96px;
  }

  .product-name,
  .brand-divider {
    display: none;
  }

  .url-prefix {
    display: none;
  }

  .url-form {
    grid-template-columns: 1fr auto;
  }

  .url-form input {
    padding-left: 10px;
  }

  main {
    padding: 34px 14px 60px;
  }

  .intro {
    display: block;
    margin-bottom: 26px;
  }

  .intro-meta {
    margin-top: 18px;
  }

  .intro-meta p {
    max-width: 180px;
  }

  .device-grid {
    gap: 18px;
  }

  .stage {
    min-height: 320px;
    padding-inline: 12px;
  }
}

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