html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #222;
  font-family: system-ui, sans-serif;
  overflow: hidden;
}

#toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  background: #111;
  color: #eee;
  font-size: 14px;
  box-sizing: border-box;
  z-index: 10;
}
#toolbar input[type=text] {
  flex: 1;
  min-width: 120px;
  max-width: 520px;
  height: 30px;
  font: 13px monospace;
  padding: 0 8px;
  background: #222;
  color: #eee;
  border: 1px solid #555;
  border-radius: 4px;
}
#toolbar button {
  height: 30px;
  padding: 0 14px;
  font-size: 13px;
  background: #2c6bed;
  color: #fff;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
#toolbar label { display: flex; align-items: center; gap: 5px; cursor: pointer; user-select: none; white-space: nowrap; }
#toolbar select { height: 30px; background: #222; color: #eee; border: 1px solid #555; border-radius: 4px; }

/* devices dropdown */
#devdrop { position: relative; }
#devdrop summary {
  height: 30px;
  line-height: 30px;
  padding: 0 12px;
  background: #222;
  border: 1px solid #555;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  list-style: none;
  white-space: nowrap;
}
#devdrop summary::-webkit-details-marker { display: none; }
#devdrop[open] summary { background: #2c6bed; border-color: #2c6bed; }
#devdrop .devpanel {
  position: absolute;
  top: 38px;
  left: 0;
  min-width: 290px;
  max-height: 60vh;
  overflow-y: auto;
  background: #161616;
  border: 1px solid #555;
  border-radius: 6px;
  padding: 8px;
  z-index: 50;
}
.devpresets { display: flex; gap: 6px; margin-bottom: 8px; }
.devpresets button {
  height: 26px;
  padding: 0 10px;
  font-size: 12px;
  background: #333;
  color: #eee;
  border: 1px solid #555;
  border-radius: 4px;
  cursor: pointer;
}
.devpresets button:hover { background: #2c6bed; }
#devlist label {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 12px/1.9 monospace;
  color: #ddd;
  cursor: pointer;
  white-space: nowrap;
}

#viewport {
  position: fixed;
  top: 48px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: auto;
}
#sizer { position: relative; }
#stage {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  gap: 40px;
  align-items: flex-start;
  padding: 24px 40px;
  transform-origin: 0 0;
  width: max-content;
}

.phone { display: flex; flex-direction: column; align-items: center; }
.bezel { position: relative; background: #000; }
.screen {
  position: relative;
  overflow: hidden;
  background: var(--chrome-bg, #0b0b1a);
}
.homebtn {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 46px;
  height: 46px;
  border: 2px solid #2c2c2e;
  border-radius: 50%;
  box-sizing: border-box;
}
.caption {
  margin-top: 10px;
  color: #bbb;
  font: 12px/1.4 monospace;
  text-align: center;
  max-width: 440px;
}
.caption .xorigin { color: #e0a040; display: block; }
.caption .est { color: #888; }
.skipcaption {
  color: #e0a040;
  font: 12px/1.4 monospace;
  align-self: center;
  padding: 20px 10px;
}

/* status bar */
.statusbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 5;
}
.statusbar .time {
  position: absolute;
  transform: translate(-50%, -50%);
  color: #fff;
  font-weight: 600;
  font-family: system-ui, -apple-system, sans-serif;
  white-space: nowrap;
}
.statusbar .sicons {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
}
.statusbar .sicons svg { display: block; }

/* cutouts */
.cutout-island { position: absolute; background: #000; z-index: 6; }
.cutout-notch {
  position: absolute;
  top: 0;
  background: #000;
  z-index: 6;
}

/* safari chrome */
.urlpill {
  position: absolute;
  border-radius: 22px;
  background: #131318;
  box-shadow: 0 0 0 0.5px #2b2b33;
  z-index: 6;
  display: flex;
  align-items: center;
}
.urlpill .uicon { position: absolute; color: #fff; display: flex; }
.urlpill .domain {
  width: 100%;
  text-align: center;
  color: #fff;
  font: 17px/44px system-ui, -apple-system, sans-serif;
  white-space: nowrap;
  overflow: hidden;
}
.toolpill {
  position: absolute;
  background: #131318;
  box-shadow: 0 0 0 0.5px #2b2b33;
  z-index: 6;
}
.toolpill .ticon { position: absolute; top: 50%; transform: translate(-50%, -50%); color: #fff; display: flex; }
.toolpill .ticon.dim { color: #8e8e93; }

/* page iframe */
iframe.page {
  position: absolute;
  left: 0;
  border: 0;
  background: #0b0b1a;
}

/* home indicator */
.homeind {
  position: absolute;
  height: 5px;
  border-radius: 3px;
  background: #fff;
  z-index: 8;
}

/* zones overlay — geometry set inline */
.zone { position: absolute; display: none; pointer-events: none; z-index: 20; }
body.zones .zone { display: block; }
.z-chrome { background: rgba(255, 0, 0, 0.25); }
.z-safe { background: rgba(0, 120, 255, 0.35); }
.z-viewport { border: 1px dashed #0f0; box-sizing: border-box; }
