:root {
  --bg: #0b0d12;
  --panel: #11151d;
  --line: #232937;
  --text: #e6e8ee;
  --muted: #8c93a3;
  --accent: #2f7cf6;
  /* Space to keep clear at the bottom: what the browser reports, or what the
     app remembered from last time (see main.js). */
  --safe-bottom: max(env(safe-area-inset-bottom), var(--nav-fallback, 0px));
  /* The REMIX tag on the app icon */
  --remix: #ffd166;
  --remix-text: #151a23;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font:
    15px/1.4 system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  /* Keep clear of the notch and of Android's navigation buttons: the
     installed app draws behind them (viewport-fit=cover). */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) var(--safe-bottom) env(safe-area-inset-left);
}

button,
input {
  font: inherit;
  color: inherit;
}

/* Install prompt */
#install-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 12px;
  background: #1a2130;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
#install-bar img {
  flex: none;
  border-radius: 6px;
}
#install-text {
  flex: 1;
  min-width: 0;
}
#install-bar button {
  flex: none;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
#install-bar #install-no {
  width: 32px;
  padding: 0;
  background: none;
  color: var(--muted);
}

/* Notice bars: update ready, offline, restore multi-view */
.bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 12px;
  background: #1a2130;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.bar-text {
  flex: 1;
  min-width: 0;
}
.bar button {
  flex: none;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.bar .bar-close {
  width: 30px;
  padding: 0;
  background: none;
  color: var(--muted);
}
#offline-bar {
  background: #3a2a14;
}

/* "Ns behind · Jump to live" on the app's own player, only when it has fallen behind */
.live-chip {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 15px;
  background: rgb(0 0 0 / 0.75);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* Loading spinner while a tile's player starts */
.spinner {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 3px solid rgb(255 255 255 / 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  pointer-events: none;
  animation: spin 0.8s linear infinite;
}
.tile.loading .spinner {
  display: block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* A stream loading ahead of a tap, or a Kick stream kept warm after
   switching away: hidden behind the stage */
.tile.preparing,
.tile.parked {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  pointer-events: none;
}

/* The stream being replaced stays on top until the new one plays */
.tile.leaving {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

/* Player + chat */
#stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#watch {
  flex: none;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
#player {
  --cols: 1;
  /* Sideways swipes step through the embeds (stage.js); up and down stay with the page. */
  touch-action: pan-y;
  flex: none;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 60dvh;
  background: #000;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 2px;
}
/* Portrait: two streams stack, three or four make a 2x2 grid. */
#player[data-count='2'] {
  aspect-ratio: 8 / 9;
  max-height: 72dvh;
}
#player[data-count='3'],
#player[data-count='4'] {
  --cols: 2;
}
/* Focus layout (⋮ button, multi-view): the stream with the sound is big and
   the others small. Portrait puts the small ones in a row underneath;
   the row layout (below) stacks them beside it. --others is set by
   layoutTiles in stage.js. */
body.focus.multi #player {
  --cols: 1;
  grid-template-columns: repeat(var(--others, 1), minmax(0, 1fr));
  grid-template-rows: minmax(0, 3fr) minmax(0, 1fr);
  aspect-ratio: 4 / 3;
  max-height: 72dvh;
}
body.focus.multi #player .tile.has-sound {
  grid-column: 1 / -1;
  grid-row: 1;
}

.tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: #000;
}
.tile-body,
.tile-body > *,
.tile-body iframe {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  border: 0;
}
.own-player {
  background: #000;
  object-fit: contain;
}
/* Audio only: a card with the stream's name over the tile, the sound
   controls along the bottom (the tile rule above stretches children). */
.tile-body > .audio-only {
  display: grid;
  place-content: center;
  gap: 4px;
  padding: 16px 16px 60px;
  text-align: center;
  background: #000;
  color: var(--text);
}
.tile-body > .audio-only b {
  font-size: 18px;
}
.tile-body > .audio-only span {
  color: var(--muted);
  font-size: 13px;
}
.tile-body > audio.own-player {
  top: auto;
  height: 44px !important;
}
.pip-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}
#cast-now {
  margin-top: 12px;
}
.tile-body > .empty p {
  margin: 0 0 12px;
}
.tile-body > .empty .retry {
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}
.tile-body > .empty {
  display: grid;
  place-items: center;
  padding: 16px;
  color: var(--muted);
  text-align: center;
}
.tile-bar {
  display: none;
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  max-width: calc(100% - 12px);
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background: rgb(0 0 0 / 0.65);
  font-size: 12px;
  font-weight: 600;
}
body.multi .tile-bar {
  display: flex;
}
.tile-name {
  min-width: 0;
  padding: 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tile-bar button {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.tile-bar svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.tile-sound[aria-pressed='true'] {
  color: var(--remix);
}
body.multi .tile.has-sound {
  outline: 2px solid var(--remix);
  outline-offset: -2px;
  z-index: 1;
}

.sound-chip {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 0;
  border-radius: 22px;
  background: rgb(0 0 0 / 0.75);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.sound-chip svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

#chat {
  flex: 1;
  min-height: 0;
  position: relative;
  background: var(--panel);
}
#chat iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
#chat iframe:not(.loaded) {
  visibility: hidden;
}
#chat:has(iframe:not(.loaded))::before {
  content: 'Loading chat…';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

/* Loading placeholders before anything has arrived: a spinner in the empty
   player, and faint tabs until the live list comes in. */
#player:empty::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 3px solid rgb(255 255 255 / 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
#tabs:empty:not(.loaded) {
  background:
    linear-gradient(var(--line), var(--line)) 12px 50% / 72px 10px no-repeat,
    linear-gradient(var(--line), var(--line)) 104px 50% / 56px 10px no-repeat,
    linear-gradient(var(--line), var(--line)) 180px 50% / 84px 10px no-repeat;
  animation: placeholder-pulse 1.2s ease-in-out infinite alternate;
}
@keyframes placeholder-pulse {
  to {
    opacity: 0.4;
  }
}
body.no-chat #chat,
body.no-chat #chat-resizer {
  display: none !important;
}
#chat-resizer {
  display: none;
}
body.resizing {
  cursor: col-resize;
  user-select: none;
  -webkit-user-select: none;
}
body.resizing iframe {
  pointer-events: none;
}
body.no-chat #watch {
  flex: 1;
  min-height: 0;
}
body.no-chat #player {
  flex: 1;
  aspect-ratio: auto;
  max-height: none;
}
body.no-chat #player[data-count='2'] {
  --cols: 1;
}

/* Live embed tabs, like the row under destiny.gg's bigscreen player */
/* The row looks 28 px tall, but the tabs and ⋮ reach 8 px above and below
   it (transparent), so each is a 44 px tap target. */
#tabbar {
  flex: none;
  position: relative;
  z-index: 6;
  height: 29px;
  display: flex;
  align-items: stretch;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
#tabs {
  flex: 1;
  min-width: 0;
  display: flex;
  height: 44px;
  margin: -8px 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
#menu-btn {
  flex: none;
  position: relative;
  width: 40px;
  height: 44px;
  margin: -8px 0;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
#menu-btn::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  border-left: 1px solid var(--line);
}
#menu-btn .icon-close,
#menu-btn[aria-expanded='true'] .icon-more {
  display: none;
}
#menu-btn[aria-expanded='true'] .icon-close {
  display: block;
}

/* The row of action icons that slides out over the tabs */
#actions {
  position: absolute;
  top: 0;
  right: 40px;
  bottom: 0;
  left: 0;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  background: var(--panel);
  animation: actions-in 0.15s ease-out;
}
@keyframes actions-in {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
}
#actions button {
  flex: 0 1 44px;
  min-width: 0;
  position: relative;
  height: 44px;
  margin: -8px 0;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
#actions button[hidden] {
  display: none;
}
#actions button:hover,
#actions button[aria-pressed='true'] {
  color: var(--text);
}
#actions svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
#actions button:focus-visible {
  outline: none;
}
#actions button:focus-visible::after {
  content: '';
  position: absolute;
  inset: 9px 4px;
  border: 2px solid var(--accent);
  border-radius: 6px;
}

#menu-btn:hover {
  color: var(--text);
}
#menu-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
#tabs::-webkit-scrollbar {
  display: none;
}
#tabs .tab {
  flex: none;
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  max-width: 200px;
  padding: 0 10px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
#tabs .tab[aria-current='true'] {
  color: var(--text);
}
#tabs .tab[aria-current='true']::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  height: 2px;
  background: currentColor;
}
#tabs .tab.offline {
  opacity: 0.55;
  font-style: italic;
}
/* Favorites are pinned to the front with a small star. */
#tabs .tab.fav .name::before {
  content: '★ ';
  color: var(--remix);
  font-size: 0.85em;
}
#fav-btn[aria-pressed='true'] svg {
  fill: var(--remix);
}
/* The stream with the sound left the live list: say so, and offer the most-embedded one. */
.tile-body > .ended {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-content: center;
  gap: 10px;
  padding: 16px;
  text-align: center;
  background: rgba(0, 0, 0, 0.72);
  color: var(--text);
}
.tile-body > .ended p {
  margin: 0;
}
.tile-body > .ended button {
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
}
#tabs .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* A YouTube video chatters embedded (not a live stream): a small play mark. */
#tabs .tab.video .name::after {
  content: ' ▶';
  font-size: 9px;
  color: var(--muted);
}
#tabs .platform-icon {
  flex: none;
  width: 13px;
  height: 13px;
  fill: currentColor;
}

/* Side by side: landscape phones, tablets, desktops and ultrawides. Keep in
   sync with rowLayoutQuery in js/util.js. */
@media (orientation: landscape) and (min-aspect-ratio: 4/3), (min-width: 1000px) and (min-aspect-ratio: 1/1) {
  /* The stream takes the whole height on the left; the tab row sits on top
     of chat on the right, so it doesn't cost the stream any room. */
  #stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto min(var(--chat-w, clamp(300px, 26vw, 440px)), calc(100% - 320px));
    grid-template-rows: auto minmax(0, 1fr);
  }
  #watch {
    display: contents;
  }
  #player,
  #player[data-count] {
    grid-column: 1;
    grid-row: 1 / 3;
    min-height: 0;
    aspect-ratio: auto;
    max-height: none;
  }
  #chat-resizer {
    display: block;
    grid-column: 2;
    grid-row: 1 / 3;
    position: relative;
    z-index: 2;
    width: 10px;
    margin: 0 -5px;
    cursor: col-resize;
    touch-action: none;
  }
  body.chat-left #stage {
    grid-template-columns: min(var(--chat-w, clamp(300px, 26vw, 440px)), calc(100% - 320px)) auto minmax(0, 1fr);
  }
  body.chat-left #player {
    grid-column: 3;
  }
  body.chat-left #tabbar,
  body.chat-left #chat {
    grid-column: 1;
  }
  #chat-resizer::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 4px;
    width: 1px;
    background: var(--line);
  }
  #chat-resizer:hover::after,
  body.resizing #chat-resizer::after {
    left: 3px;
    width: 3px;
    background: var(--accent);
  }
  #tabbar {
    grid-column: 3;
    grid-row: 1;
  }
  #chat {
    grid-column: 3;
    grid-row: 2;
    width: auto;
    min-height: 0;
  }
  body.focus.multi #player {
    grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
    grid-template-rows: repeat(var(--others, 1), minmax(0, 1fr));
  }
  body.focus.multi #player .tile.has-sound {
    grid-column: 1;
    grid-row: 1 / -1;
  }
  /* Chat hidden: the tab row goes back under the full-width stream. */
  body.no-chat #stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }
  body.no-chat #player {
    grid-row: 1;
  }
  body.no-chat #tabbar {
    grid-column: 1;
    grid-row: 2;
  }
}

/* Landscape on phones (setting): the stream fills the screen, chat is a
   see-through overlay on the right, and the tab row slides up from the
   bottom on a tap (or the handle, which reaches over other sites' players). */
#overlay-btn,
#tabs-handle {
  display: none;
}
@media (orientation: landscape) and (max-height: 600px) and (pointer: coarse) {
  body.landscape-full #stage {
    display: block;
    position: relative;
  }
  body.landscape-full #watch {
    display: block;
  }
  body.landscape-full #player,
  body.landscape-full #player[data-count] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    aspect-ratio: auto;
  }
  body.landscape-full #chat-resizer {
    display: none;
  }
  body.landscape-full #tabbar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 7;
    transform: translateY(100%);
    transition: transform 0.15s;
  }
  body.landscape-full.show-tabs #tabbar,
  body.landscape-full #tabbar:focus-within {
    transform: none;
  }
  body.landscape-full #chat {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 34%;
    min-width: 220px;
    z-index: 5;
    opacity: 0.75;
    background: transparent;
  }
  body.landscape-full.overlay-off #chat {
    display: none;
  }
  body.landscape-full:not(.no-chat) #overlay-btn {
    display: grid;
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 8;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: rgb(0 0 0 / 0.5);
    color: #fff;
  }
  body.landscape-full #overlay-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
  }
  body.landscape-full #overlay-btn[aria-pressed='false'] {
    opacity: 0.6;
  }
  body.landscape-full:not(.show-tabs) #tabs-handle {
    display: block;
    position: absolute;
    left: 50%;
    bottom: 0;
    z-index: 8;
    width: 64px;
    height: 20px;
    margin-left: -32px;
    border: 0;
    background: transparent;
  }
  body.landscape-full #tabs-handle::after {
    content: '';
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 5px;
    height: 4px;
    border-radius: 2px;
    background: rgb(255 255 255 / 0.55);
  }
}

/* Stream preview above a tab (hover, or while holding on touch). */
#preview {
  position: fixed;
  z-index: 20;
  width: 192px;
  transform: translateY(calc(-100% - 8px));
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.5);
  pointer-events: none;
}
#preview img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 5px;
  background: #000;
}

/* Latest from Destiny (settings, while he's offline). */
#latest-list {
  display: grid;
  gap: 6px;
}
.latest-item {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  height: auto;
  padding: 6px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
}
.latest-item img {
  flex: none;
  width: 96px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  background: #000;
}
.latest-item span {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.latest-item b {
  font-size: 13px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.latest-item small {
  color: var(--muted);
}

/* Settings sheet */
dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
}
dialog::backdrop {
  background: rgb(0 0 0 / 0.6);
}
dialog h2 {
  margin: 4px 0 8px;
  font-size: 16px;
}
dialog h2:not(:first-child) {
  margin-top: 20px;
}
dialog code {
  color: var(--text);
}
.row {
  display: flex;
  gap: 8px;
}
.row.end {
  justify-content: flex-end;
  margin-top: 16px;
}
dialog button {
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
dialog button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.toggle {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
}
.toggle input {
  width: 20px;
  height: 20px;
  margin: 0;
  flex: none;
  accent-color: var(--accent);
}
.select-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}
.select-row select {
  flex: none;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.links button {
  gap: 8px;
}
.links button svg {
  flex: none;
  width: 18px;
  height: 18px;
  fill: currentColor;
  opacity: 0.85;
}
#sheet-actions {
  margin: 4px 0 12px;
}
.hint details,
details.hint {
  margin-top: 12px;
}
details.hint summary {
  cursor: pointer;
  color: var(--text);
}
details.hint p {
  margin: 8px 0 0;
}
.sheet-subhead {
  margin: 20px 0 0;
  font-size: 14px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  margin: 12px 0 0;
}
#cast-steps p {
  margin: 12px 0 0;
}
#tabs .tab:hover {
  color: var(--text);
}

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(16px + var(--safe-bottom));
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 10px 14px;
  border-radius: 10px;
  background: #222838;
  box-shadow: 0 4px 20px rgb(0 0 0 / 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
#toast.show {
  opacity: 1;
}

/* One-time tip pointing at ⋮ */
#menu-tip {
  position: fixed;
  z-index: 20;
  max-width: min(260px, calc(100vw - 16px));
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--remix);
  color: var(--remix-text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  box-shadow: 0 4px 20px rgb(0 0 0 / 0.5);
  cursor: pointer;
  animation: tip-in 0.2s ease-out;
}
#menu-tip::after {
  content: '';
  position: absolute;
  right: 14px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: var(--remix);
  transform: rotate(45deg);
}
#menu-tip.below::after {
  top: -6px;
  bottom: auto;
}
@keyframes tip-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* What's new, at the bottom of the menu */
#changelog {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
#changelog h3 {
  margin: 0 0 6px;
  font-size: 14px;
}
#changelog h4 {
  margin: 12px 0 4px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
#changelog ul {
  margin: 0;
  padding-left: 18px;
}
#changelog li {
  margin: 3px 0;
}
#changelog summary {
  margin-top: 10px;
  color: var(--muted);
  cursor: pointer;
}

/* Phones: menus are bottom sheets that can be swiped down */
.sheet-handle {
  display: none;
}
@media (max-width: 640px) {
  dialog {
    width: 100%;
    max-width: none;
    max-height: 85dvh;
    margin: auto 0 0;
    border-width: 1px 0 0;
    border-radius: 16px 16px 0 0;
    padding-bottom: calc(16px + var(--safe-bottom));
  }
  dialog[open] {
    animation: sheet-up 0.2s ease-out;
  }
  .sheet-handle {
    display: block;
    width: 36px;
    height: 4px;
    margin: -6px auto 10px;
    border-radius: 2px;
    background: var(--line);
  }
}
@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }
}

/* Keyboard focus */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
#tabs .tab:focus-visible,
#menu-btn:focus-visible {
  outline: none;
}
#tabs .tab:focus-visible::before,
#menu-btn:focus-visible::after {
  content: '';
  position: absolute;
  inset: 9px 1px;
  border: 2px solid var(--accent);
  border-radius: 6px;
}
#chat-resizer:focus-visible {
  outline: none;
}
#chat-resizer:focus-visible::after {
  left: 3px;
  width: 3px;
  background: var(--accent);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Less motion for people who ask for it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.hint.tagline {
  margin: -4px 0 8px;
}
