:root {
  --ink: #06304f;
  --ink-soft: #1d5378;
  --glass: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(236, 250, 255, 0.6) 46%, rgba(190, 236, 255, 0.62));
  --rim: inset 0 1px 0 #fff, inset 0 0 0 1px rgba(255, 255, 255, 0.55), 0 18px 50px rgba(0, 60, 130, 0.35), 0 2px 6px rgba(0, 50, 110, 0.25);
  --font: "Frutiger", "Frutiger Linotype", "Segoe UI", "Myriad Pro", "Lucida Grande", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

:root[data-dark] {
  --glass: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(236, 250, 255, 0.9) 46%, rgba(206, 242, 255, 0.92));
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #2f8fe6;
  color: var(--ink);
  font: 16px/1.4 var(--font);
  -webkit-text-size-adjust: 100%;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 6px #0a62c9;
}

/* The still and the world */

#still,
#world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

#still svg {
  display: block;
  width: 100%;
  height: 100%;
}

#world {
  display: block;
  opacity: 0;
  transition: opacity 0.45s ease;
  touch-action: none;
  outline: none;
  cursor: grab;
}

:root[data-gl="on"] #world {
  opacity: 1;
}

:root[data-gl="on"][data-settled] #still {
  display: none;
}

:root[data-gl="off"] #world {
  display: none;
}

.s-drift {
  animation: s-drift 120s linear infinite;
}

.s-bob {
  animation: s-bob 7s ease-in-out infinite alternate;
}

.s-bob2 {
  animation-duration: 9s;
  animation-delay: -3s;
}

.s-rise {
  animation: s-bob 5s ease-in-out infinite alternate-reverse;
}

@keyframes s-drift {
  to {
    transform: translateX(-260px);
  }
}

@keyframes s-bob {
  from {
    transform: translateY(-5px);
  }
  to {
    transform: translateY(6px);
  }
}

/* Glass */

#panel,
#panel-toggle,
#caption,
#use,
#jump,
#gesture,
#gestures button,
.plaque,
#stick,
.dw-commission {
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--rim);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
}

#panel {
  position: fixed;
  z-index: 5;
  top: 20px;
  left: 20px;
  width: min(410px, calc(100vw - 40px));
  max-height: calc(100dvh - 40px);
  display: flex;
  border-radius: 26px;
  overflow: hidden;
  transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.2, 1), opacity 0.3s ease, visibility 0s;
}

#panel::before,
#caption::before,
#panel-toggle::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto;
  height: 46%;
  max-height: 120px;
  border-radius: 25px 25px 60% 60% / 25px 25px 22px 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.08));
  pointer-events: none;
}

#panel[data-open="false"] {
  transform: translateX(-30px) scale(0.96);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s ease, opacity 0.25s ease, visibility 0s 0.3s;
}

.panel-scroll {
  position: relative;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 22px 18px;
  width: 100%;
}

#panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#panel h1 {
  margin: 0;
  font-size: 42px;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: #04395f;
  text-shadow: 0 1px 0 #fff;
}

.line {
  margin: 6px 0 10px;
  font-size: 16px;
  color: var(--ink);
}

#links h2 {
  margin: 11px 2px 5px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

#links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

#links li {
  min-width: 0;
}

#links li.wide {
  grid-column: 1 / -1;
}

#links ul.pills {
  grid-template-columns: repeat(3, 1fr);
}

#links a {
  position: relative;
  display: block;
  height: 100%;
  padding: 6px 10px 7px 38px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(222, 244, 255, 0.72) 50%, rgba(196, 234, 255, 0.82));
  box-shadow: inset 0 1px 0 #fff, 0 1px 3px rgba(0, 60, 120, 0.25);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

#links a:hover,
#links a:focus-visible {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #fff, #e6f8ff 50%, #c9f0ff);
  box-shadow: inset 0 1px 0 #fff, 0 6px 16px rgba(0, 80, 160, 0.35);
}

#links a::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 9px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff 0 14%, transparent 34%), radial-gradient(circle at 50% 60%, hsl(var(--hue, 195) 95% 62%), hsl(var(--hue, 195) 90% 36%));
  box-shadow: 0 1px 2px rgba(0, 40, 90, 0.5);
}

#links a b {
  display: block;
  font-size: 17px;
  font-weight: 600;
}

#links a small {
  display: block;
  font-size: 14px;
  line-height: 1.3;
  color: var(--ink-soft);
}

#links li:not(.wide) a small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#links a[data-prominence="high"] b {
  font-size: 19px;
}

#links ul.pills a {
  padding-right: 6px;
}

.builds,
.footnote {
  margin: 8px 2px 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.builds {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 10px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(6, 80, 140, 0.16);
  box-shadow: inset 0 1px 3px rgba(0, 50, 110, 0.3);
}

.builds a,
.builds span {
  min-width: 84px;
  padding: 4px 16px;
  border-radius: 999px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.builds span {
  background: linear-gradient(180deg, #fff, #d8f3ff);
  box-shadow: 0 1px 3px rgba(0, 50, 110, 0.4);
}

.builds a:hover {
  background: rgba(255, 255, 255, 0.5);
}

#panel-close,
.dw-commission button,
.sign-actions button {
  font: 600 16px var(--font);
  color: #fff;
  padding: 9px 22px;
  border-radius: 999px;
  border: 1px solid #0a62c9;
  background: linear-gradient(180deg, #7fd4ff, #1f97f2 48%, #0a6fdc 52%, #36b1ff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 3px 8px rgba(0, 70, 160, 0.4);
  text-shadow: 0 1px 1px rgba(0, 40, 100, 0.6);
  cursor: pointer;
}

#panel-close {
  flex: none;
  padding: 7px 18px;
}

#panel-toggle {
  position: fixed;
  z-index: 4;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px 9px 10px;
  border-radius: 999px;
  font: 600 17px var(--font);
  color: var(--ink);
  cursor: pointer;
}

#panel-toggle::before {
  border-radius: 999px 999px 40px 40px;
}

#panel-toggle[aria-expanded="true"] {
  visibility: hidden;
}

.orb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff 0 14%, transparent 36%), radial-gradient(circle at 50% 60%, #5fe0ff, #0a7fe0);
  box-shadow: 0 1px 3px rgba(0, 40, 90, 0.5);
}

/* Plaques, the tour's caption, and the buttons over the world */

#plaques {
  position: fixed;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.plaque {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px 5px 8px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(226, 246, 255, 0.86));
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  will-change: transform, opacity;
  font-family: var(--font);
  pointer-events: none;
}

/* A project's label: its name, one line under it, and it is a button. */
button.plaque {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: start;
  column-gap: 7px;
  padding: 6px 16px 7px 10px;
  border-radius: 18px;
  text-align: left;
  cursor: pointer;
}

button.plaque b {
  font-size: 17px;
}

button.plaque small {
  grid-column: 2;
  max-width: 250px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.25;
  white-space: normal;
  color: var(--ink-soft);
}

button.plaque:hover {
  background: linear-gradient(180deg, #fff, #cdefff);
}

.plaque::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 2px;
  height: 14px;
  margin-left: -1px;
  background: linear-gradient(180deg, #fff, rgba(255, 255, 255, 0));
}

.plaque i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0 12%, transparent 40%), var(--c);
  box-shadow: 0 0 0 1px rgba(0, 40, 90, 0.25);
}

.plaque em {
  font-style: normal;
  font-weight: 400;
  color: var(--ink-soft);
}

#caption {
  position: fixed;
  z-index: 3;
  left: calc(50% + var(--shift, 0px));
  transform: translateX(-50%);
  border-radius: 999px;
  text-align: center;
  white-space: nowrap;
}

#caption {
  bottom: 86px;
  padding: 10px 34px 12px;
  display: flex;
  align-items: baseline;
  gap: 16px;
}

#caption .count {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-soft);
}

#caption .name {
  font-size: 38px;
  font-weight: 300;
  letter-spacing: -0.01em;
  color: #04395f;
}

#stick {
  position: fixed;
  z-index: 3;
  left: 22px;
  bottom: calc(22px + env(safe-area-inset-bottom));
  width: 124px;
  height: 124px;
  border-radius: 50%;
  touch-action: none;
}

#stick span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  margin: -27px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff 0 14%, transparent 40%), radial-gradient(circle at 50% 60%, #7fe3ff, #0a7fe0);
  box-shadow: 0 3px 8px rgba(0, 50, 110, 0.5);
}

#use,
#jump,
#gesture,
#gestures button {
  position: fixed;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  font: 600 17px var(--font);
  color: var(--ink);
  cursor: pointer;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

#use {
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  padding: 9px 20px 10px 12px;
  max-width: calc(100vw - 24px);
  white-space: nowrap;
}

kbd {
  font: 600 14px var(--font);
  padding: 1px 8px;
  border-radius: 7px;
  border: 1px solid rgba(6, 48, 79, 0.35);
  background: rgba(255, 255, 255, 0.7);
}

#gestures {
  position: fixed;
  z-index: 3;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

#gestures button {
  position: static;
  padding: 8px 16px 9px 10px;
}

/* A phone: the stick on the left, Jump and the use button on the right, and no key names. */
:root[data-touch="true"] kbd {
  display: none;
}

:root[data-touch="true"] #use {
  left: auto;
  right: 22px;
  bottom: calc(138px + env(safe-area-inset-bottom));
  transform: none;
  padding: 12px 20px;
}

:root[data-touch="true"] #gestures button {
  padding: 10px 16px;
}

#jump {
  right: 22px;
  bottom: calc(30px + env(safe-area-inset-bottom));
  width: 96px;
  height: 96px;
  justify-content: center;
  font-size: 19px;
}

#gesture {
  right: 132px;
  bottom: calc(30px + env(safe-area-inset-bottom));
  padding: 12px 18px;
}

/* Other visitors: names and bubbles over their robots, the chat, the mirror's card (together.js). */
#tags {
  position: fixed;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.tag,
.bubble {
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
  opacity: 0;
  will-change: transform, opacity;
}

.tag {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 1px 9px 2px;
  border: 0;
  border-radius: 999px;
  font: 600 14px var(--font);
  white-space: nowrap;
  color: #04395f;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(226, 246, 255, 0.66));
  box-shadow: inset 0 1px 0 #fff, 0 1px 4px rgba(0, 50, 110, 0.3);
}

button.tag {
  cursor: pointer;
}

/* The clerk's name tag's word, laid over the badge on a robot's chest while the camera is near (play/nametag.js). */
.badge {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  will-change: transform, opacity;
  border-radius: 12%/20%;
  overflow: hidden;
  white-space: nowrap;
  text-align: center;
  letter-spacing: 0.02em;
  color: #2a1a3a;
  background: linear-gradient(180deg, #fff6d0 0 22%, #ffd23a 22%);
  box-shadow: 0 1px 2px rgba(60, 40, 0, 0.35);
}

.tag b {
  font-weight: 600;
}

.tag em {
  padding: 0 6px;
  border-radius: 999px;
  font: 600 14px var(--font);
  color: #fff;
  background: #1c86c9;
}

.bubble {
  max-width: 230px;
  padding: 7px 13px 8px;
  border-radius: 16px 16px 16px 4px;
  font: 500 15px/1.3 var(--font);
  overflow-wrap: anywhere;
  color: var(--ink);
  background: var(--glass);
  box-shadow: var(--rim);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  backdrop-filter: blur(10px) saturate(1.4);
}

/* A line said on the stage, high over the Square. */
.bubble.stage {
  max-width: min(560px, 82vw);
  padding: 10px 22px 12px;
  border-radius: 22px;
  font: 600 30px/1.2 var(--font);
  text-align: center;
  color: #04395f;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(214, 244, 255, 0.62));
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(255, 255, 255, 0.7), 0 6px 26px rgba(0, 90, 170, 0.35);
}

:root[data-touch="true"] .bubble.stage {
  font-size: 22px;
}

#chat-chip,
#chat,
#say,
#who-menu {
  position: fixed;
  z-index: 3;
  left: 14px;
  color: var(--ink);
  font: 500 15px/1.35 var(--font);
  background: var(--glass);
  box-shadow: var(--rim);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  backdrop-filter: blur(14px) saturate(1.5);
}

#chat-chip {
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px 8px 12px;
  border: 0;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

#chat-chip i {
  width: 14px;
  height: 12px;
  border-radius: 6px 6px 6px 2px;
  background: linear-gradient(180deg, #7fe3ff, #0a7fe0);
}

#chat-chip[data-unread] i {
  background: linear-gradient(180deg, #ffd66b, #ff8a1f);
}

/* Alone: one quiet line, and nothing to press. */
#chat-chip.quiet {
  font-weight: 500;
  opacity: 0.82;
  cursor: default;
}

#chat-chip.quiet i {
  background: rgba(6, 48, 79, 0.3);
}

#chat {
  bottom: 62px;
  width: min(340px, calc(100vw - 28px));
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
}

#chat header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 6px 14px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
}

#chat-room {
  flex: 1;
}

#chat header button,
#chat-open,
#who-menu button,
#mirror button[type="submit"] {
  padding: 3px 12px 4px;
  border: 0;
  border-radius: 999px;
  font: 600 15px var(--font);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 0 0 1px rgba(6, 48, 79, 0.18);
  cursor: pointer;
}

#chat-log {
  margin: 0;
  padding: 6px 12px;
  height: 148px;
  overflow-y: auto;
  list-style: none;
  overscroll-behavior: contain;
}

#chat-log li {
  padding: 2px 0;
  overflow-wrap: anywhere;
}

#chat-log .who {
  padding: 0;
  border: 0;
  font: 700 15px var(--font);
  color: var(--ink);
  background: none;
  cursor: pointer;
}

#chat-log .who:disabled {
  cursor: default;
}

/* The developer's controls (admin.js), only with the token. */
#chat-log .admin-tools {
  display: inline-flex;
  gap: 4px;
  margin-left: 6px;
  vertical-align: 1px;
}

#chat .admin {
  padding: 1px 9px 2px;
  border: 0;
  border-radius: 999px;
  font: 600 14px var(--font);
  color: #8a1f00;
  background: rgba(255, 236, 220, 0.85);
  box-shadow: inset 0 0 0 1px rgba(138, 31, 0, 0.25);
  cursor: pointer;
}

#chat .admin:disabled {
  color: var(--ink-soft);
  cursor: default;
}

#chat-log i {
  margin: 0 6px;
  font-style: normal;
  font-size: 14px;
  color: var(--ink-soft);
}

#chat-note {
  margin: 0;
  padding: 4px 14px 5px;
  font-size: 14px;
  color: #8a3b00;
  background: rgba(255, 236, 200, 0.75);
}

#chat-open {
  margin: 0 8px 8px;
  padding: 6px 14px 7px;
  text-align: left;
  font-weight: 500;
  color: var(--ink-soft);
}

#say {
  bottom: 14px;
  width: min(340px, calc(100vw - 28px));
  border-radius: 999px;
}

#say-line {
  width: 100%;
  padding: 9px 18px 10px;
  border: 0;
  border-radius: 999px;
  font: 500 17px var(--font);
  color: var(--ink);
  background: none;
}

#who-menu {
  z-index: 5;
  padding: 5px;
  border-radius: 999px;
}

/* A phone: the chat is at the top right, clear of the stick and the buttons, and the input stands on the keyboard. */
:root[data-touch="true"] #chat-chip {
  left: auto;
  right: 10px;
  bottom: auto;
  top: calc(10px + env(safe-area-inset-top));
}

:root[data-touch="true"] #chat {
  left: auto;
  right: 10px;
  bottom: auto;
  top: calc(56px + env(safe-area-inset-top));
}

:root[data-touch="true"] #chat-log {
  height: 96px;
}

:root[data-touch="true"] #chat-open {
  display: none;
}

:root[data-touch="true"] #say {
  left: 10px;
  right: 10px;
  width: auto;
  bottom: max(calc(var(--kb, 0px) + 10px), calc(204px + env(safe-area-inset-bottom)));
}

#mirror {
  width: min(330px, calc(100vw - 32px));
  margin: auto auto 12vh;
  padding: 16px;
  border: 0;
  border-radius: 22px;
  color: var(--ink);
  font: 500 16px var(--font);
  background: var(--glass);
  box-shadow: var(--rim);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  backdrop-filter: blur(14px) saturate(1.5);
}

#mirror[open] {
  position: fixed;
  inset: 0;
  z-index: 4;
}

#mirror form {
  display: grid;
  gap: 12px;
}

#mirror-name {
  padding: 9px 14px;
  border: 1px solid rgba(6, 48, 79, 0.3);
  border-radius: 12px;
  font: 600 17px var(--font);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
}

#mirror-note {
  margin: -6px 2px 0;
  font-size: 14px;
  color: #8a3b00;
}

#mirror-colours {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}

.swatch {
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.9) 0 12%, transparent 42%), var(--c);
  box-shadow: 0 1px 4px rgba(0, 50, 110, 0.4);
  cursor: pointer;
}

.swatch[aria-pressed="true"] {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

#mirror label {
  display: flex;
  align-items: center;
  gap: 8px;
}

#mirror button[type="submit"] {
  justify-self: end;
  padding: 7px 20px 8px;
}

/* The guestbook's card at the lectern (square.js) */

#sign {
  width: min(380px, calc(100vw - 32px));
  padding: 18px;
  border: 0;
  border-radius: 22px;
  color: var(--ink);
  font: 500 16px var(--font);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(226, 246, 255, 0.95));
  box-shadow: var(--rim);
}

#sign::backdrop {
  background: rgba(6, 60, 120, 0.3);
  backdrop-filter: blur(4px);
}

#sign form {
  display: grid;
  gap: 10px;
}

#sign h2 {
  margin: 0 2px;
  font-size: 24px;
  font-weight: 300;
}

#sign-name,
#sign-message {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #8fc4e6;
  border-radius: 12px;
  font: 500 17px var(--font);
  color: var(--ink);
  background: #fff;
  box-shadow: inset 0 2px 4px rgba(0, 60, 120, 0.15);
  resize: none;
}

#sign-note {
  margin: -2px 2px 0;
  font-size: 15px;
  color: #8a3b00;
}

.sign-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.sign-actions button[aria-disabled="true"] {
  opacity: 0.6;
}

/* The commission dialog of core/commission.js, in glass */

.dw-commission {
  width: min(460px, calc(100vw - 32px));
  padding: 24px;
  border-radius: 24px;
  color: var(--ink);
  font: 16px/1.4 var(--font);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(226, 246, 255, 0.95));
}

.dw-commission::backdrop {
  background: rgba(6, 60, 120, 0.4);
  backdrop-filter: blur(4px);
}

.dw-commission-title {
  margin: 0 0 4px;
  font-size: 28px;
  font-weight: 300;
}

.dw-commission-note,
.dw-commission-status,
.dw-commission-error {
  margin: 4px 0;
  font-size: 15px;
  color: var(--ink-soft);
}

.dw-commission-error {
  color: #a3122e;
}

.dw-commission-field {
  margin-top: 12px;
}

.dw-commission-label {
  display: block;
  font-size: 15px;
  font-weight: 600;
}

.dw-commission-input {
  width: 100%;
  margin-top: 4px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid #8fc4e6;
  background: #fff;
  box-shadow: inset 0 2px 4px rgba(0, 60, 120, 0.15);
  color: var(--ink);
  font: 16px var(--font);
}

.dw-commission-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.dw-commission button.dw-commission-cancel,
.sign-actions button[type="button"] {
  color: var(--ink);
  border-color: #9cc9e6;
  background: linear-gradient(180deg, #fff, #dff3ff);
  text-shadow: none;
}

/* A phone: the panel is a sheet at the bottom */

@media (max-width: 700px) {
  #panel {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    width: auto;
    max-height: 58dvh;
    border-radius: 22px;
  }

  #panel[data-open="false"] {
    transform: translateY(30px) scale(0.98);
  }

  #panel h1 {
    font-size: 34px;
  }

  .panel-scroll {
    padding: 16px 14px 14px;
  }

  #panel-toggle {
    top: calc(10px + env(safe-area-inset-top));
    left: 10px;
  }

  /* The panel is a sheet over the lower half, so the still's island is lifted clear of it. */
  #still svg {
    transform: translateY(-16%) scale(1.25);
  }

  #caption {
    bottom: auto;
    top: calc(64px + env(safe-area-inset-top));
    padding: 8px 22px 10px;
    gap: 10px;
  }

  #caption .name {
    font-size: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Getting about: the sound switch, the map, the telescope's strip, the plaque by an island's pad */

#sound,
#map,
#scope,
#map-close,
#scope button {
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--rim);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
  color: var(--ink);
  font-family: var(--font);
}

/* The ticket counter (play/play.css) holds the top right corner, so on a desk the sound button takes the bottom right. */
#sound {
  position: fixed;
  z-index: 3;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

/* A phone keeps the chat at the top right: the sound button stands under the name, or under the chat while it is open,
   and gives way to the tour's caption. */
:root[data-touch="true"] #sound {
  right: auto;
  bottom: auto;
  left: 10px;
  top: calc(64px + env(safe-area-inset-top));
}

/* The open chat reaches 191px down: 56px from the top, its header, and a log 96px high. */
:root[data-touch="true"] body:has(#chat:not([hidden])) #sound {
  top: calc(202px + env(safe-area-inset-top));
}

:root[data-touch="true"] body:has(#caption:not([hidden])) #sound {
  visibility: hidden;
}

#sound i {
  width: 20px;
  height: 18px;
  background: var(--ink);
  -webkit-mask: var(--glyph) center / contain no-repeat;
  mask: var(--glyph) center / contain no-repeat;
  --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 18' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 6.5h3.5L10 2.5v13l-4.5-4H2z' fill='%23000'/%3E%3Cpath d='M13.5 6.5l4 5M17.5 6.5l-4 5'/%3E%3C/svg%3E");
}

#sound[aria-pressed="true"] i {
  --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 18' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 6.5h3.5L10 2.5v13l-4.5-4H2z' fill='%23000'/%3E%3Cpath d='M13 6q1.6 3 0 6M15.6 3.6q3.4 5.4 0 10.8'/%3E%3C/svg%3E");
}

#map {
  width: min(1080px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  padding: 8px;
  border-radius: 28px;
  overflow: auto;
}

.map-body {
  position: relative;
}

#map::backdrop {
  background: radial-gradient(circle at 50% 45%, rgba(20, 110, 200, 0.12), rgba(4, 40, 90, 0.45));
}

.map-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  max-height: calc(100dvh - 40px);
  margin: 0 auto;
  border-radius: 21px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

#map-picture {
  display: block;
  width: 100%;
  height: 100%;
}

#map-places {
  position: absolute;
  inset: 0;
}

/* A narrow screen has no room for a name on each island: the picture marks them, and the names stand below it, each
   chip as wide as its name. The picture gives up height so every name stays on the glass. */
#map.list[open],
#map.list .map-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#map.list .map-frame {
  flex: 0 1 auto;
  width: 100%;
  min-height: 140px;
  aspect-ratio: 1 / 1;
}

#map.list #map-places {
  position: static;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 8px 0 2px;
}

#map.list .chip {
  flex: 1 1 auto;
  justify-content: center;
  position: static;
  transform: none;
  min-height: clamp(34px, 6dvh, 40px);
  padding: 4px 10px 4px 8px;
  font-size: 13px;
}

.chip {
  position: absolute;
  transform: translate(-50%, -100%);
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 5px 13px 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(214, 243, 255, 0.86));
  box-shadow: 0 6px 16px rgba(0, 50, 110, 0.35), inset 0 1px 0 #fff;
  color: var(--ink);
  font: 600 14px var(--font);
  white-space: nowrap;
  cursor: pointer;
}

.chip i {
  flex: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0 12%, transparent 40%), var(--c);
  box-shadow: 0 0 0 1px rgba(0, 40, 90, 0.25);
}

.chip:hover {
  background: linear-gradient(180deg, #fff, #c9eeff);
}

.chip[aria-current] {
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--c), 0 6px 18px rgba(0, 50, 110, 0.45);
}

.chip.locked {
  border-color: rgba(255, 255, 255, 0.3);
  background: linear-gradient(180deg, rgba(44, 56, 78, 0.88), rgba(18, 26, 42, 0.88));
  color: rgba(255, 255, 255, 0.5);
  cursor: default;
}

.chip.locked i {
  background: #2a3242;
}

#map-close {
  position: absolute;
  top: 18px;
  right: 18px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

/* The telescope: a round glass the world is seen through, and a strip at its foot. */
#scope:not([open]) {
  display: none;
}

#scope {
  position: fixed;
  inset: auto 0 calc(24px + env(safe-area-inset-bottom));
  z-index: 5;
  margin: 0 auto;
  width: max-content;
  max-width: calc(100vw - 24px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 999px;
}

#scope p {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 150px;
  margin: 0 4px;
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
}

#scope p::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0 12%, transparent 40%), var(--c);
  box-shadow: 0 0 0 1px rgba(0, 40, 90, 0.25);
}

#scope-count {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  font-size: 15px;
}

#scope-count svg {
  width: 13px;
  height: 15px;
  fill: var(--ink);
}

#scope button {
  min-width: 44px;
  height: 44px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

#scope-done {
  padding: 0 18px;
}

#scope-prev i,
#scope-next i {
  display: block;
  width: 11px;
  height: 11px;
  margin: 0 auto;
  border: solid var(--ink);
  border-width: 0 0 2.5px 2.5px;
  transform: translateX(2px) rotate(45deg);
}

#scope-next i {
  transform: translateX(-2px) rotate(-135deg);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 44%, transparent 0 34vmin, rgba(190, 240, 255, 0.5) 35vmin, rgba(6, 40, 80, 0.55) 37vmin, rgba(2, 20, 44, 0.86) 70vmin);
  opacity: 0;
  transition: opacity 0.4s ease;
}

body:has(#scope[open])::after {
  opacity: 1;
}

body:has(#map[open]) #plaques,
body:has(#map[open]) #tags,
body:has(#scope[open]) #plaques,
body:has(#scope[open]) #tags {
  visibility: hidden;
}

/* The plaque by an island's pad: its name, and the one thing to press. */
button.plaque.legacy small {
  justify-self: start;
  margin-top: 5px;
  padding: 3px 12px 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #6ad8ff, #0a7fe0);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  color: #fff;
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  body::after {
    transition: none;
  }
}
