/* The canvas itself. Fixed, so it looks the same on every machine. */
:root {
  --ui-bg: #e9e9ec;
  --ui-dot: #cfcfd6;
  --ui-panel: #ffffff;
  --ui-text: #18181b;
  --ui-muted: #6b6b76;
  --ui-line: #d9d9df;
  --ui-accent: #3b5bfd;
  --ui-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ui-mono: ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--ui-bg);
  color: var(--ui-text);
  font: 13px/1.4 var(--ui-font);
  overflow: hidden;
}

.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  height: 48px; padding: 0 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--ui-panel); border-bottom: 1px solid var(--ui-line);
}
.bar-left, .bar-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.logo { font-weight: 700; letter-spacing: -0.01em; }
.meta { color: var(--ui-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
select, button {
  font: inherit; color: inherit;
  height: 30px; padding: 0 10px;
  background: var(--ui-panel); border: 1px solid var(--ui-line); border-radius: 6px;
  cursor: pointer;
}
select { max-width: 260px; }
button:hover, select:hover { border-color: var(--ui-muted); }
#zoom-level { min-width: 58px; font-variant-numeric: tabular-nums; }

.viewport {
  position: fixed; inset: 48px 0 0 0;
  overflow: hidden; cursor: grab; outline: none;
  background-color: var(--ui-bg);
  background-image: radial-gradient(var(--ui-dot) 1px, transparent 1px);
  background-size: 24px 24px;
  touch-action: none;
}
.viewport.dragging { cursor: grabbing; }

.world {
  position: absolute; top: 0; left: 0;
  transform-origin: 0 0;
  padding: 160px;
  display: grid;
  gap: 160px 200px;
  align-items: start;
}

/* Column headers (screens) and row headers (styles) */
.col-head {
  font-size: 56px; font-weight: 700; letter-spacing: -0.02em;
  border-bottom: 4px solid var(--ui-text); padding-bottom: 16px;
}
.row-head { width: 420px; padding-top: 56px; }
.row-head h2 { font-size: 56px; line-height: 1.05; margin: 0 0 16px; letter-spacing: -0.02em; }
.row-head p { font-size: 24px; color: var(--ui-muted); margin: 0 0 28px; }
.swatches { display: flex; gap: 10px; }
.swatches span { width: 48px; height: 48px; border-radius: 50%; border: 2px solid rgb(0 0 0 / 0.12); }

/* A cell holds one screen in one style: phone and desktop side by side */
.cell { display: flex; gap: 64px; align-items: flex-start; }
.frame { display: flex; flex-direction: column; gap: 14px; }
.frame-label {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font: 22px var(--ui-mono); color: var(--ui-muted);
}
.frame-label a { color: var(--ui-accent); text-decoration: none; }
.frame-label a:hover { text-decoration: underline; }
.device {
  position: relative; overflow: hidden; background: #fff;
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.08), 0 24px 60px rgb(0 0 0 / 0.14);
  cursor: zoom-in;
}
.device.phone { border-radius: 52px; border: 12px solid #111; }
.device.desktop { border-radius: 14px; border: 1px solid #c9c9d0; }
.device.desktop::before {
  content: ""; display: block; height: 36px; background: #f1f1f4; border-bottom: 1px solid #dcdce2;
  background-image: radial-gradient(circle, #ff5f57 6px, transparent 7px), radial-gradient(circle, #febc2e 6px, transparent 7px), radial-gradient(circle, #28c840 6px, transparent 7px);
  background-size: 24px 36px; background-repeat: no-repeat;
  background-position: 12px 0, 36px 0, 60px 0;
}
.device iframe { display: block; border: 0; pointer-events: none; background: #fff; }
.slot {
  display: flex; flex-direction: column; justify-content: center; gap: 16px;
  padding: 0 12%; font-family: var(--ui-font);
}
.slot-bar { width: 96px; height: 12px; border-radius: 6px; }
.slot strong { font-size: 64px; line-height: 1.05; letter-spacing: -0.02em; }
.slot span:last-child { font-size: 28px; opacity: 0.55; }
.missing {
  display: grid; place-items: center; text-align: center; color: var(--ui-muted);
  font: 24px var(--ui-mono); background: repeating-linear-gradient(45deg, #f6f6f8, #f6f6f8 16px, #efeff2 16px, #efeff2 32px);
}

[hidden] { display: none !important; }
.empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 16px; }
.empty h1 { margin: 0 0 8px; font-size: 22px; }
.empty p { margin: 0; color: var(--ui-muted); }
.empty code { font-family: var(--ui-mono); background: var(--ui-panel); padding: 2px 6px; border-radius: 4px; }

.hint {
  position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 10;
  padding: 6px 12px; border-radius: 999px;
  background: rgb(24 24 27 / 0.82); color: #fff; font-size: 12px; white-space: nowrap;
  pointer-events: none;
}
@media (max-width: 640px) {
  .hint { display: none; }
  .meta { display: none; }
  .logo { display: none; }
  .bar { padding: 0 8px; gap: 6px; }
  .bar-left, .bar-right { gap: 4px; }
  select { max-width: 150px; min-width: 0; }
  #zoom-level { min-width: 48px; }
  select, button { padding: 0 8px; }
}
