:root {
  color-scheme: dark;
  --bg: #0e0e12;
  --panel: #18181f;
  --border: #2b2b36;
  --fg: #ececf1;
  --muted: #9a9aab;
  --accent: #fcee0a;
  --accent-fg: #07070b;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { display: flex; flex-direction: column; background: var(--bg); color: var(--fg); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.brand { font-size: 14px; white-space: nowrap; }
.url { flex: 1; display: flex; gap: 8px; min-width: 0; }
.url input { flex: 1; min-width: 0; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); color: var(--fg); font-size: 14px; }
.url button, .controls button { height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); color: var(--fg); font: inherit; font-size: 14px; cursor: pointer; }
.gh { color: var(--muted); font-size: 13px; text-decoration: none; }

.stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.device[data-laptop] { border-radius: 12px 12px 4px 4px !important; }
.device { position: relative; flex: none; background: #000; box-shadow: 0 30px 80px rgb(0 0 0 / 0.5); transform-origin: center; }
.device[hidden] { display: none; }
.device iframe { display: block; border: 0; background: #fff; }
/* The hinge, drawn over the crease: taps on it go nowhere, as on the device. */
.crease { position: absolute; display: none; background: linear-gradient(to bottom, #050505, #2a2a2e 45%, #2a2a2e 55%, #050505); }
.crease[data-fold="vertical"] { background: linear-gradient(to right, #050505, #2a2a2e 45%, #2a2a2e 55%, #050505); }
.hint { position: absolute; inset-inline: 16px; bottom: 12px; margin: 0 auto; max-width: 560px; padding: 10px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--border); color: var(--muted); font-size: 13px; line-height: 1.45; }
.hint code { color: var(--fg); }
.hint a { color: var(--accent); }
.empty { color: var(--muted); max-width: 420px; text-align: center; line-height: 1.5; padding: 24px; }

.controls { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 16px max(env(safe-area-inset-bottom), 12px); }
.segmented { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--panel); border: 1px solid var(--border); }
.segmented button { border: 0; border-radius: 999px; min-height: 40px; padding: 0 18px; background: transparent; color: var(--muted); }
.segmented button[aria-selected="true"] { background: var(--accent); color: var(--accent-fg); }
.picker { height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel); color: var(--fg); font: inherit; font-size: 14px; }
.segmented[hidden], .controls .icon[hidden] { display: none; }
.controls .icon { width: 44px; height: 44px; border-radius: 999px; padding: 0; font-size: 18px; }
.size { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* Narrow screens (a phone, a split-screen window): the URL field gets its own row, the controls wrap and centre. */
@media (max-width: 640px) {
  .bar { flex-wrap: wrap; }
  .url { order: 3; flex-basis: 100%; }
  .controls { flex-wrap: wrap; row-gap: 8px; }
  .segmented button { padding: 0 12px; }
}
