/* Quantum Lens — instrument chrome over a full-bleed camera view. */

:root {
  --ink: #e8f0ff;
  --dim: #8fa3c4;
  --line: rgba(140, 190, 255, 0.22);
  --panel: rgba(8, 13, 24, 0.72);
  --accent: #7ee0ff;
  --warm: #ffd16b;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #05070d;
  color: var(--ink);
  font: 400 15px/1.5 ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

#video { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

/* ------------------------------------------------------------- banner */

#banner {
  position: fixed;
  top: calc(12px + var(--safe-top));
  left: 12px;
  /* A fixed width, not shrink-to-fit: the text arrives after the first
     layout, and the lens is sized against this box at startup. */
  width: min(58vw, 460px);
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

body.running #banner,
body.running #panel,
body.running #controls { opacity: 1; transform: none; }

.banner-line {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

#regime-name {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

#mag-badge {
  font: 500 13px/1 ui-monospace, Menlo, Consolas, monospace;
  color: var(--accent);
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  white-space: nowrap;
}

#regime-tag {
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 2px;
}

#regime-note {
  font-size: 13px;
  color: var(--dim);
  margin-top: 6px;
}

/* ------------------------------------------------------------- readout */

#panel {
  position: fixed;
  top: calc(12px + var(--safe-top));
  right: 12px;
  width: 268px;
  max-height: calc(100vh - 210px - var(--safe-top));
  overflow-y: auto;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  scrollbar-width: thin;
}

body.panel-hidden #panel { display: none; }

.readout-group + .readout-group { margin-top: 12px; }

.readout-group h3 {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.85;
}

.readout-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 0;
}

.readout-label {
  font-size: 12px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.readout-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 500 12.5px/1.4 ui-monospace, Menlo, Consolas, monospace;
  text-align: right;
  white-space: nowrap;
}

.swatch {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: 0 0 6px currentColor;
}

#sourcelabel {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--dim);
}

/* ------------------------------------------------------------ controls */

#controls {
  position: fixed;
  left: 12px;
  right: 12px;
  max-width: 1180px;
  margin: 0 auto;
  bottom: calc(10px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#layerchips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  font: 500 11.5px/1 ui-sans-serif, -apple-system, sans-serif;
  color: var(--dim);
  background: rgba(8, 13, 24, 0.66);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.chip.on {
  color: var(--ink);
  border-color: rgba(126, 224, 255, 0.55);
  background: rgba(20, 44, 66, 0.72);
}

#dial-wrap {
  position: relative;
  padding: 26px 8px 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

#dial-ticks {
  position: relative;
  height: 20px;
  margin: 0 6px;
}

.tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
  font: 500 10px/1 ui-sans-serif, -apple-system, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
  background: none;
  border: 0;
  padding: 2px 3px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.tick:hover { color: var(--ink); }
.tick.active { color: var(--warm); }

#dial {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 26px;
  background: none;
  cursor: ew-resize;
}

#dial::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, #4a6a94, var(--accent), #b98cff);
}

#dial::-moz-range-track {
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, #4a6a94, var(--accent), #b98cff);
}

#dial::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -8.5px;
  border-radius: 50%;
  background: #0b1220;
  border: 2px solid var(--warm);
  box-shadow: 0 0 12px rgba(255, 209, 107, 0.5);
}

#dial::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0b1220;
  border: 2px solid var(--warm);
}

#aperture-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
  padding: 0 2px;
}

#aperture-row label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
}

#aperture {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 16px;
  background: none;
  cursor: ew-resize;
}

#aperture::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 206, 130, 0.35);
}

#aperture::-moz-range-track {
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 206, 130, 0.35);
}

#aperture::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--warm);
}

#aperture::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: var(--warm);
}

#buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

#buttons button {
  flex: 0 1 150px;
  min-width: 62px;
  font: 500 12.5px/1 ui-sans-serif, -apple-system, sans-serif;
  color: var(--ink);
  background: rgba(8, 13, 24, 0.7);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 8px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#buttons button:hover { border-color: rgba(126, 224, 255, 0.5); }
#buttons button.on { color: var(--accent); border-color: rgba(126, 224, 255, 0.45); }
#btn-about { flex: 0 0 44px; min-width: 44px; }

/* ----------------------------------------------------------- overlays */

#intro, #about, #capture {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(120% 90% at 50% 0%, #10182c 0%, #05070d 70%);
  z-index: 10;
  overflow-y: auto;
  transition: opacity 0.6s ease;
}

#about, #capture { background: rgba(4, 6, 12, 0.9); backdrop-filter: blur(8px); }

#intro.hidden, #about.hidden, #capture.hidden {
  opacity: 0;
  pointer-events: none;
}

.sheet {
  position: relative;
  max-width: 620px;
  width: 100%;
  padding: 28px;
  background: rgba(10, 16, 28, 0.86);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin: auto;
}

.sheet h1 {
  margin: 0 0 12px;
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.sheet h2 { margin: 0 0 12px; font-size: 20px; font-weight: 600; }

.sheet h3 {
  margin: 20px 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.sheet p, .sheet li { color: #c6d4ea; }
.sheet ul { margin: 0; padding-left: 18px; }
.sheet li { margin: 5px 0; font-size: 13.5px; }
.sheet li b { color: var(--ink); font-weight: 600; }

.lede { font-size: 16px; }
.fine { font-size: 13px; color: var(--dim); }
.dim { opacity: 0.75; margin-bottom: 0; }
.keys { font-size: 13px; color: var(--dim); }

#begin {
  margin: 20px 0 10px;
  font: 600 15px/1 ui-sans-serif, -apple-system, sans-serif;
  color: #05070d;
  background: linear-gradient(120deg, var(--accent), #b0f0ff);
  border: 0;
  border-radius: 10px;
  padding: 14px 22px;
  cursor: pointer;
}

#begin:hover { filter: brightness(1.08); }

#capture-image {
  display: block;
  width: 100%;
  height: auto;
  margin: 14px 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

#about-close, #capture-close {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 24px;
  line-height: 1;
  color: var(--dim);
  background: none;
  border: 0;
  cursor: pointer;
}

@media (max-width: 720px) {
  #panel {
    top: auto;
    bottom: calc(var(--controls-h, 210px) + 16px + var(--safe-bottom));
    right: 10px;
    left: 10px;
    width: auto;
    max-height: 38vh;
  }

  #banner { width: calc(100vw - 24px); }
  #regime-note { display: none; }

  /* Nine labels will not fit across a phone, so the rungs become dots that
     are still targets; the banner already names the one you are on. */
  #dial-ticks { height: 14px; margin: 0 10px; }

  .tick {
    font-size: 0;
    padding: 4px;
    color: var(--dim);
  }

  .tick::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
  }

  .tick.active { color: var(--warm); }
  .tick.active::after { box-shadow: 0 0 8px currentColor; }

  #buttons button {
    flex: 1 1 0;
    min-width: 0;
    font-size: 11.5px;
    padding: 11px 4px;
  }

  #btn-about { flex: 0 0 38px; min-width: 38px; }
  .chip { padding: 6px 9px; font-size: 11px; }
  .sheet { padding: 22px 18px; }
  .sheet h1 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  #banner, #panel, #controls, #intro, #about, #capture { transition: none; }
}

/* ---------------------------------------------------------- light source */

#light {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.light-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

#light-k {
  font: 700 22px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: -0.02em;
  transition: color 0.6s, text-shadow 0.6s;
}

#light-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

#light-card {
  display: block;
  width: 100%;
  height: 96px;
  margin-top: 6px;
}

#light-basis {
  font-size: 10px;
  color: var(--dim);
  margin-top: 2px;
}

#light.folded #light-card,
#light.folded #light-basis { display: none; }

/* Folded is the resting state: the one-line reading is the fact, and the
   Planck curve is there when you tap for it. The card was a third of the
   banner's height on every screen otherwise. */
#light.folded #light-k { font-size: 17px; }

@media (max-width: 720px) {
  #light-card { height: 72px; }
}

/* ------------------------------------------------------------ recognition */

#ident {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

#ident.hidden { display: none; }

.ident-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

#ident-label {
  font-size: 17px;
  font-weight: 600;
  text-transform: capitalize;
}

#ident-conf {
  font: 12px ui-monospace, monospace;
  color: var(--warm);
}

.ident-row {
  display: flex;
  gap: 8px;
  font-size: 11px;
  margin-top: 3px;
}

.ident-key {
  flex: 0 0 68px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 9.5px;
  padding-top: 1px;
}

.ident-val { flex: 1; color: var(--ink); }

#ident-note {
  margin-top: 6px;
  font-size: 9.5px;
  color: var(--dim);
  font-style: italic;
}

#ident-correct {
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 10.5px;
  text-decoration: underline;
  cursor: pointer;
}

#ident-fix {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

#ident-fix.hidden { display: none; }

.fixchip {
  font: inherit;
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(16, 26, 44, 0.8);
  color: var(--ink);
  cursor: pointer;
}

.fixchip:hover { border-color: var(--accent); }

/* The banner lets pointers through so the lens can be dragged under it;
   its interactive cards have to opt back in or they can never be tapped. */
#light, #ident, #ident-correct, .fixchip { pointer-events: auto; }

#ident { position: relative; }

#ident-close {
  position: absolute;
  top: 2px;
  right: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--dim);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
}

#ident-close:hover { color: var(--ink); }

/* The identity card sits above the controls, not over the lens: it is an
   answer about the thing in the aperture, so it must not cover it. */
#ident {
  position: fixed;
  left: 12px;
  bottom: calc(var(--controls-h, 210px) + 16px + var(--safe-bottom));
  width: min(420px, calc(100vw - 24px));
  max-height: 42vh;
  overflow-y: auto;
  margin: 0;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-radius: 12px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 3;
}

#ident.folded #ident-props,
#ident.folded #ident-correct,
#ident.folded #ident-fix,
#ident.folded #ident-note { display: none; }

.ident-head { cursor: pointer; padding-right: 26px; }

@media (max-width: 720px) {
  #ident { width: calc(100vw - 20px); left: 10px; max-height: 34vh; }
}

#ident-keep {
  margin-left: auto;
  margin-right: 24px;        /* clear of the close button */
  font: inherit;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: rgba(20, 42, 60, 0.9);
  color: var(--accent);
  cursor: pointer;
  pointer-events: auto;
  white-space: nowrap;
}

#ident-keep.on {
  color: #08131f;
  background: var(--accent);
  border-color: var(--accent);
}

.ident-head { display: flex; align-items: baseline; gap: 8px; }

.sheet ul.howto {
  margin: 4px 0 10px;
  padding-left: 18px;
}

.sheet ul.howto li { margin-bottom: 4px; }

.sheet table.rungs {
  border-collapse: collapse;
  margin: 4px 0 12px;
  font-size: 12px;
}

.sheet table.rungs td { padding: 3px 12px 3px 0; vertical-align: top; }
.sheet table.rungs td:first-child { color: var(--accent); white-space: nowrap; }

/*
 * Where you are on the ladder. The tick rail shows the chain, but on a phone
 * its labels collapse to dots and the note line is hidden, so this one line
 * carries the two things the rail cannot: which rung of the nine, and how
 * wide the view really is in metres.
 */
#crumb {
  font-size: 11.5px;
  color: var(--dim);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

/*
 * A chip whose layer has no rung here. Dimmed rather than hidden: it still
 * says what the instrument can do, and the row does not reflow under the
 * thumb every time the dial passes a rung. Still tappable, so a layer can be
 * armed before descending to it.
 */
.chip.idle {
  opacity: 0.42;
  border-style: dashed;
}

/* A button whose rung is elsewhere. Same treatment as an idle chip. */
#buttons button.idle { opacity: 0.42; }

/*
 * The temperature row. Sits under the aperture and reads like it, with the
 * value beside it because the number is the point -- in auto the slider is a
 * gauge showing what the scene's agitation comes to, and `auto` is lit while
 * that is what it is doing.
 */
#temp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

#temp-row label {
  font: 500 11px/1 ui-sans-serif, -apple-system, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
  flex: 0 0 auto;
}

#temp-row input { flex: 1 1 auto; min-width: 60px; }

#temp-read {
  font: 500 11.5px/1 ui-monospace, Menlo, monospace;
  color: var(--ink);
  flex: 0 0 auto;
  min-width: 58px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#temp-auto {
  font: 500 11px/1 ui-sans-serif, -apple-system, sans-serif;
  color: var(--dim);
  background: rgba(8, 13, 24, 0.7);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 8px;
  cursor: pointer;
  flex: 0 0 auto;
}

#temp-auto.on { color: var(--accent); border-color: rgba(126, 224, 255, 0.45); }

/* ------------------------------------------------- short screens */
/*
 * A laptop is wide and short. At 1280x800 the readout wants about 1020px of
 * height and has 590, so two thirds of it sat below the fold -- it scrolled,
 * but nothing said so, and the panel simply appeared to stop at Resonance.
 *
 * Three things, in order of how much they buy: lay it out in two columns,
 * since a short screen is nearly always a wide one; tighten the rows; and
 * fade the bottom edge whenever there is still more below, so a panel that
 * does have to scroll says so.
 */
/* Laptops: wide and short. A phone is short too but has none of the room
   these rules spend, so they are scoped to the width as well. */
@media (min-width: 1000px) and (max-height: 900px) {
  /* The rung's description is in the ? panel too; on a short screen the
     height it costs is better spent on the aperture. */
  #regime-note { display: none; }

  #panel {
    max-height: calc(100vh - 150px - var(--safe-top));
    padding: 10px 12px;
  }

  .readout-group + .readout-group { margin-top: 9px; }
  .readout-group h3 { margin-bottom: 4px; }
  .readout-row { padding: 1px 0; }
  .readout-label { font-size: 11.5px; }
  .readout-value { font-size: 11.5px; line-height: 1.3; }
}

/*
 * Two columns of readout, because the room is sideways. Either a laptop
 * (wide and short, where the panel cannot otherwise fit) or any screen wide
 * enough that a 544px panel costs nothing -- at 1920x1080 the single column
 * still left a group and a half below the fold.
 */
@media (min-width: 1120px) and (max-height: 900px), (min-width: 1500px) {
  #panel { width: 544px; }

  #readouts {
    column-count: 2;
    column-gap: 18px;
    column-rule: 1px solid var(--line);
  }

  /* A group split down the middle of a column reads as two groups. */
  .readout-group {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
  }

  .readout-group + .readout-group { margin-top: 0; padding-top: 9px; }
}

/*
 * The scroll hint. `--panel-fade` is set from app.js to 1 when there is more
 * readout below the fold and 0 when there is not, so the edge only softens
 * when something is actually hidden behind it.
 */
#panel {
  --panel-fade: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 34px),
                      rgba(0, 0, 0, calc(1 - var(--panel-fade))) 100%);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 34px),
              rgba(0, 0, 0, calc(1 - var(--panel-fade))) 100%);
}

/*
 * The chain of sizes, on the dial's own rail. Each stop sits where the view
 * is about twenty times that structure, so turning the dial walks past them
 * in order -- which is the only way fifteen orders of magnitude read as a
 * journey rather than as a number.
 */
#chain {
  position: relative;
  height: 15px;
  margin: 2px 10px 0;
}

#chain .stop {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
  font: 500 9.5px/1 ui-sans-serif, -apple-system, sans-serif;
  letter-spacing: 0.02em;
  color: var(--dim);
  opacity: 0.75;
  pointer-events: none;
}

/* A stop that belongs to the thing in the aperture, rather than a typical
   value for its kind, is the accent colour: the difference matters. */
#chain .stop.own { color: var(--accent); opacity: 0.9; }

#chain .stop::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -3px;
  width: 1px;
  height: 3px;
  background: currentColor;
  opacity: 0.6;
}

/* The one the dial is on. */
#chain .stop.here { opacity: 1; font-weight: 650; }

/* No room for a row of labels on a phone: the breadcrumb carries the
   nearest stop instead, as one more clause on a line that is already there. */
@media (max-width: 720px) { #chain { display: none; } }

/* ------------------------------------------------------------ quiet */
/*
 * Everything the instrument has gained -- the readout, twenty chips, three
 * sliders, the chain, the identity card -- is around the edge of the one
 * thing it is for. After a few seconds of not touching anything, all of it
 * fades and leaves the lens and the world; the next touch brings it back.
 *
 * The canvas is untouched: the figure, the captions and the lens chrome are
 * drawn there, and they are the picture, not the furniture.
 */
body.quiet #banner,
body.quiet #panel,
body.quiet #controls,
body.quiet #ident {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

/*
 * Bare: the lens and the dials, and nothing else. Between everything and
 * nothing, and the state you actually want while looking -- the banner keeps
 * one line saying which rung you are on, the dial and its chain stay, and
 * the readout, the chips, the spectrum card and the identity card all go.
 */
body.bare #panel,
body.bare #ident,
body.bare #layerchips,
body.bare #light,
body.bare #regime-note,
body.bare #temp-row { display: none; }

body.bare #banner {
  background: none;
  border-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 2px 4px;
}

body.bare #regime-tag { font-size: 10px; }

/* With everything hidden there is nothing to sit above. */
body.quiet #hint {
  opacity: 0.55;
  bottom: calc(14px + var(--safe-bottom, 0px));
}

/* Says which state Clear just moved to, for a moment. */
#hint.say { opacity: 0.8; }

#hint {
  position: fixed;
  left: 50%;
  /* Above the controls, not across them: with the controls up it sat on the
     button row and read as a label for whichever button it landed on. */
  bottom: calc(var(--controls-h, 60px) + 14px + var(--safe-bottom, 0px));
  transform: translateX(-50%);
  font: 500 11px/1 ui-sans-serif, -apple-system, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

/*
 * The new-build notice. The worker takes over as soon as it installs, but
 * the page keeps running the code it already has, so without this the only
 * way to know a deploy had landed was to close the app, open it twice, and
 * read a build number out of the ? panel.
 */
#update {
  position: fixed;
  left: 50%;
  top: calc(10px + var(--safe-top, 0px));
  transform: translateX(-50%) translateY(-16px);
  z-index: 60;
  font: 600 12px/1 ui-sans-serif, -apple-system, sans-serif;
  letter-spacing: 0.02em;
  color: #06202c;
  background: var(--accent);
  border-radius: 999px;
  padding: 10px 16px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  cursor: pointer;
}

#update.ready {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
