:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #151515;
  color: #f7f7f7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(254, 152, 0, 0.08), transparent 280px),
    #151515;
}

button,
.button {
  border: 0;
  border-radius: 7px;
  padding: 9px 13px;
  background: #fe9800;
  color: #111;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

button:disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.45;
  pointer-events: none;
}

.secondary {
  background: #2a2a2a;
  color: #f5f5f5;
  border: 1px solid #444;
}

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  min-height: 100vh;
  padding: 18px;
}

.stage,
.inspector {
  min-width: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.brand img {
  width: 36px;
  height: 36px;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 16px;
}

.brand span {
  color: #ababab;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.phone {
  position: relative;
  width: min(420px, calc(100vw - 36px));
  height: min(820px, calc(100vh - 96px));
  min-height: 560px;
  margin: 0 auto;
  overflow: hidden;
  border: 12px solid #050505;
  border-radius: 34px;
  background: #fff;
  box-shadow:
    0 22px 70px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

.phone::before {
  content: "";
  position: absolute;
  z-index: 3;
  top: 8px;
  left: 50%;
  width: 96px;
  height: 22px;
  transform: translateX(-50%);
  border-radius: 0 0 16px 16px;
  background: #050505;
}

iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.empty {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  gap: 10px;
  padding: 28px;
  background: #f8f8f8;
  color: #171717;
  text-align: center;
}

.empty h1 {
  margin: 0;
  font-size: 22px;
}

.empty p {
  margin: 0;
  color: #525252;
  line-height: 1.45;
}

.empty.hidden {
  display: none;
}

.inspector {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  max-height: calc(100vh - 36px);
}

.inspector section {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #343434;
  border-radius: 8px;
  background: #1e1e1e;
}

.inspector h2 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #bababa;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 10px 14px;
  border-bottom: 1px solid #343434;
}

.inspector section > h2 {
  padding: 12px 14px;
  border-bottom: 1px solid #343434;
}

.icon-button {
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid #444;
  background: #2a2a2a;
  color: #f5f5f5;
  font-size: 12px;
  font-weight: 700;
}

.kv {
  display: grid;
  gap: 1px;
  background: #303030;
}

.kv div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  background: #1e1e1e;
  font-size: 13px;
}

.kv span:first-child {
  color: #a3a3a3;
}

.kv span:last-child {
  overflow-wrap: anywhere;
}

.logs {
  height: 100%;
  max-height: calc(100vh - 260px);
  overflow: auto;
  padding: 8px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.log {
  padding: 5px 6px;
  border-radius: 5px;
  color: #cfcfcf;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.log + .log {
  margin-top: 2px;
}

.log.error {
  background: rgba(220, 38, 38, 0.16);
  color: #fecaca;
}

.log.warn {
  background: rgba(254, 152, 0, 0.14);
  color: #fed7aa;
}

.log.success {
  background: rgba(22, 163, 74, 0.15);
  color: #bbf7d0;
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .phone {
    height: 680px;
  }

  .inspector {
    max-height: none;
  }

  .logs {
    max-height: 320px;
  }
}

@media (max-width: 560px) {
  .shell {
    padding: 12px;
  }

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

  .actions {
    width: 100%;
    justify-content: stretch;
  }

  button,
  .button {
    flex: 1;
    text-align: center;
  }

  .phone {
    width: 100%;
    height: calc(100vh - 142px);
    min-height: 520px;
    border-width: 8px;
    border-radius: 26px;
  }
}
