/* The comparison page is deliberately dark and plain so that the two applications are the only thing that
   reads as "design" on the screen. */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  display: flex; flex-direction: column;
  background: #111113; color: #e7e7ea;
  font: 13px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
}
code, kbd { font: 12px ui-monospace, Consolas, monospace; }
kbd { padding: 1px 5px; border: 1px solid #3a3a40; border-radius: 4px; background: #1c1c20; }
a { color: #9ecbff; }

.bar {
  display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px;
  padding: 10px 14px; border-bottom: 1px solid #26262b; background: #17171a;
}
.brand { display: flex; flex-direction: column; margin-right: 6px; }
.brand strong { font-size: 14px; }
.brand span { color: #8d8d96; font-size: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.field > span { color: #8d8d96; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; }
.grow { flex: 1 1 220px; min-width: 160px; }
select, input[type="text"] {
  height: 30px; padding: 0 8px; border: 1px solid #33333a; border-radius: 6px;
  background: #0f0f11; color: inherit; font: inherit;
}
input[type="text"] { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
select:focus-visible, input:focus-visible, button:focus-visible { outline: 2px solid #6ea8ff; outline-offset: 1px; }

.seg { display: inline-flex; height: 30px; border: 1px solid #33333a; border-radius: 6px; overflow: hidden; }
.seg button {
  padding: 0 10px; border: 0; border-right: 1px solid #33333a; background: #0f0f11; color: #b9b9c2;
  font: inherit; cursor: pointer; white-space: nowrap;
}
.seg button:last-child { border-right: 0; }
.seg button:hover { color: #fff; }
.seg button[aria-checked="true"] { background: #e7e7ea; color: #111113; font-weight: 600; }

.check { display: inline-flex; align-items: center; gap: 6px; height: 30px; color: #c9c9d1; cursor: pointer; }
.ghost {
  height: 30px; padding: 0 10px; border: 1px solid #33333a; border-radius: 6px;
  background: transparent; color: #c9c9d1; font: inherit; cursor: pointer;
}
.ghost:hover { border-color: #55555e; color: #fff; }

.notice { padding: 8px 14px; background: #3a2a0c; color: #ffd98a; border-bottom: 1px solid #5a4212; white-space: pre-wrap; }

.stage { position: relative; flex: 1; min-height: 0; display: grid; gap: 12px; padding: 12px; }
.stage[data-mode="side"] { grid-template-columns: 1fr 1fr; }
.stage[data-mode="swipe"], .stage[data-mode="flip"] { grid-template-columns: 1fr; }
.stage[data-mode="swipe"] .pane, .stage[data-mode="flip"] .pane { grid-area: 1 / 1; }

.pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pane-head { display: flex; align-items: center; gap: 10px; height: 28px; flex: none; }
.tag {
  padding: 2px 8px; border-radius: 999px; background: #2a2a30; color: #e7e7ea;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
}
.tag-new { background: #00ff8d; color: #062b19; }
.meta { color: #8d8d96; font-size: 12px; }
.size { margin-left: auto; color: #8d8d96; font: 12px ui-monospace, Consolas, monospace; }

.viewport { position: relative; flex: 1; min-height: 0; overflow: hidden; border-radius: 8px; background: #0b0b0c; }
.viewport iframe.app {
  position: absolute; top: 0; left: 50%; border: 0; background: #fff; transform-origin: top left;
  box-shadow: 0 0 0 1px #2c2c33;
}
iframe.bridge { position: absolute; width: 0; height: 0; border: 0; visibility: hidden; }

/* Swipe: the iteration lies on top and is cut at the divider; the original shows to the left of it. Heads sit
   left and right. */
.stage[data-mode="swipe"] .pane[data-side="iteration"] { pointer-events: none; }
.stage[data-mode="swipe"] .pane[data-side="iteration"] .viewport { pointer-events: auto; clip-path: inset(0 0 0 var(--split, 50%)); background: transparent; }
.stage[data-mode="swipe"] .pane[data-side="iteration"] .pane-head { justify-content: flex-end; }
.stage[data-mode="swipe"] .pane[data-side="iteration"] .pane-head .meta,
.stage[data-mode="swipe"] .pane[data-side="iteration"] .pane-head .size { display: none; }
.divider {
  position: absolute; top: 52px; bottom: 12px; left: calc(12px + (100% - 24px) * var(--split-n, 0.5));
  width: 2px; margin-left: -1px; background: #00ff8d; cursor: ew-resize; z-index: 5; touch-action: none;
}
.divider::before { content: ""; position: absolute; inset: 0 -10px; }
.divider span {
  position: absolute; top: 50%; left: 50%; width: 28px; height: 44px; translate: -50% -50%;
  border-radius: 999px; background: #00ff8d; box-shadow: 0 2px 10px rgb(0 0 0 / 0.5);
}
.divider span::before { content: "‹ ›"; position: absolute; inset: 0; display: grid; place-items: center; color: #062b19; font-weight: 700; }
body.dragging iframe { pointer-events: none; }
body.dragging { cursor: ew-resize; user-select: none; }

/* Flip: one version at a time in the same place. */
.stage[data-mode="flip"] .pane { visibility: hidden; }
.stage[data-mode="flip"][data-show="original"] .pane[data-side="original"],
.stage[data-mode="flip"][data-show="iteration"] .pane[data-side="iteration"] { visibility: visible; }
.flip {
  position: absolute; right: 24px; bottom: 24px; z-index: 6; height: 36px; padding: 0 14px;
  border: 0; border-radius: 999px; background: #e7e7ea; color: #111113; font: 600 13px system-ui; cursor: pointer;
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.5);
}

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px;
  padding: 6px 14px; border-top: 1px solid #26262b; color: #8d8d96; font-size: 12px;
}
