/*
 * The view switch: a small bar to choose a width, and a stage that shows the page inside that
 * width. Colours are written out rather than tokened, because the bar has to sit on the reading
 * edition and the console edition alike.
 */
.viewbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 1rem; z-index: 120;
  display: flex; gap: 1px; padding: 3px; background: #1f201b; border: 1px solid #393930;
  border-radius: 999px; box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
}
.viewbar button {
  appearance: none; cursor: pointer; background: none; border: 0; border-radius: 999px;
  padding: .5rem .9rem; color: #a9a497; white-space: nowrap;
  font: 400 11px/1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .1em; text-transform: uppercase;
}
.viewbar button:hover { color: #e9e5db; }
.viewbar button[aria-pressed="true"] { background: #e2a63f; color: #121310; }
.viewbar button:focus-visible { outline: 2px solid #e2a63f; outline-offset: 2px; }

html[data-view] body > *:not(#view-stage):not(.viewbar):not(script):not(style) { display: none !important; }
html[data-view] body { background: #0a0d14; overflow: hidden; }
#view-stage {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: .95rem; padding: 1.4rem 1rem 4.6rem; overflow: auto;
}
#view-stage .chrome {
  display: flex; align-items: center; gap: 1.2rem; color: #8d897b;
  font: 400 11px/1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .14em; text-transform: uppercase;
}
#view-stage .chrome .out {
  appearance: none; cursor: pointer; background: none; border: 1px solid #393930; border-radius: 2px;
  color: #a9a497; padding: .4rem .7rem;
  font: 400 10px/1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase;
}
#view-stage .chrome .out:hover { color: #e9e5db; border-color: #e2a63f; }
#view-stage .chrome kbd {
  font: 400 9px/1 "JetBrains Mono", ui-monospace, monospace; border: 1px solid #393930;
  border-radius: 2px; padding: .18rem .3rem; color: #71725f;
}
#view-stage .phone {
  position: relative; flex: 0 0 auto; background: #121310; border: 1px solid #393930; border-radius: 16px;
  overflow: hidden; box-shadow: 0 34px 90px rgba(0, 0, 0, .6);
}
#view-stage iframe { border: 0; display: block; background: #121310; transform-origin: top left; }
@media (prefers-reduced-motion: reduce) { .viewbar, #view-stage { transition: none !important } }
