/* ============================================================
   DEAD AIR — styles
   Palette and metrics are the single source of truth for the
   handset chrome. App-specific rules live under their own
   comment block so a screen can be lifted out whole.
   ============================================================ */

:root {
  /* What the handset lies on: the page around the frame. */
  --room: #05070a;
  --bg: #0b0e12;
  --chrome: #141920;
  --panel: #1a2028;
  --panel2: #212832;
  --line: #2b333f;
  --text: #dfe4ea;
  --dim: #7d8794;
  --dimmer: #818fa1;
  --live: #e07b39;
  --cool: #6fa8c7;
  --me: #2c4456;

  /* Backlit surfaces. The handset never glows — it lifts one step. */
  --panel-hi: #232b36;
  --panel2-hi: #2a323d;
  --line-hi: #3b4655;
  --cool-wash: rgba(111, 168, 199, 0.09);
  --live-hi: #ea8c4e;

  /* --dimmer on --me would sit at 1.7:1; stamps inside a sent bubble
     get their own value rather than a global lift. */
  --dim-on-me: #9dafc5;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;

  /* The charging bolt, drawn rather than typed. The ⚡ character comes out
     of the colour emoji font, which ignores `color` and lands a yellow-orange
     glyph in a palette where orange means threat and nothing else. One shape,
     used at two sizes, each taking its own colour. */
  --bolt: polygon(60% 0, 10% 58%, 42% 58%, 32% 100%, 90% 38%, 55% 38%, 78% 0);

  /* Everything decelerates. Nothing bounces. */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 120ms;
  --t-med: 220ms;
  --t-slow: 320ms;
  /* A page push: longer than a control, on the curve iOS moves pages with —
     fast away, long settle. */
  --t-page: 380ms;
  --ease-page: cubic-bezier(0.32, 0.72, 0, 1);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  /* The page never scrolls — every app scrolls inside the handset — so
     there is nothing for a flick at the edge of one to rubber-band. */
  overscroll-behavior: none;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* A double-tap is two taps, not a zoom: a handset's screen does not zoom.
     The pinch is stopped in index.html. */
  touch-action: manipulation;
}

/* The room is the seat it was found on: moquette, drawn in alpha over the
   room's black (assets/room/moquette.svg), under one light that falls on the
   handset and leaves the edges to the dark. Nothing here may come out lighter
   than the frame, or the phone stops reading as an object lying on it. */
body {
  margin: 0;
  background:
    radial-gradient(ellipse 80% 70% at 44% 38%, transparent 0%, rgba(2, 3, 5, 0.55) 62%, rgba(1, 2, 3, 0.88) 100%),
    url("assets/room/moquette.svg") 0 0 / 48px 48px,
    var(--room);
  color: var(--text);
  font-family: var(--sans);
}

#root {
  min-height: 100%;
}

::-webkit-scrollbar {
  width: 0;
  height: 0;
}

button {
  font-family: var(--sans);
  color: inherit;
}

input::placeholder {
  color: var(--dimmer);
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--cool);
  outline-offset: 2px;
}

/* Full-bleed rows would clip an outset ring against the divider. */
.row:focus-visible,
.backbar:focus-visible {
  outline-offset: -2px;
}

button:disabled {
  cursor: not-allowed;
}

.pulse {
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}

.fade {
  animation: fade var(--t-slow) var(--ease) both;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Opening an app: the screen redraws rather than slides. */
.screen > * {
  animation: screen-in 200ms var(--ease) both;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   PAGES

   Moving between pages inside an app — a list to a thread, a
   thread back to the list — slides the way iOS does: the new page
   comes in from the right over the old one, which shifts a third
   of the way left and dims; back reverses it. See navigate() in
   ui/parts.js, which sets `data-nav` for the length of the move.

   Only the screen is named, so the status bar and the home bar
   stay put and the page moves between them. The pictures live
   above the document, so the pair is clipped to the screen —
   unclipped, a page sliding in from the right is drawn outside
   the handset. Each picture gets the handset's background: an app
   page is mostly transparent, and without one the old page shows
   through the new one as it slides over.
   ============================================================ */

:root[data-nav] .screen {
  view-transition-name: screen;
}

::view-transition-image-pair(screen) {
  overflow: clip;
}

::view-transition-group(screen) {
  animation-duration: var(--t-page);
  animation-timing-function: var(--ease-page);
}

::view-transition-old(screen),
::view-transition-new(screen) {
  background: var(--bg);
  mix-blend-mode: normal;
  animation-duration: var(--t-page);
  animation-timing-function: var(--ease-page);
  animation-fill-mode: both;
}

:root[data-nav="push"]::view-transition-old(screen) {
  animation-name: page-under;
}

:root[data-nav="push"]::view-transition-new(screen) {
  animation-name: page-over;
  box-shadow: -10px 0 28px rgba(0, 0, 0, 0.45);
}

/* Going back, the page on top is the one leaving. */
:root[data-nav="pop"]::view-transition-old(screen) {
  z-index: 1;
  animation-name: page-off;
  box-shadow: -10px 0 28px rgba(0, 0, 0, 0.45);
}

:root[data-nav="pop"]::view-transition-new(screen) {
  animation-name: page-back;
}

@keyframes page-over {
  from {
    transform: translateX(100%);
  }
}

@keyframes page-under {
  to {
    transform: translateX(-30%);
    filter: brightness(0.6);
  }
}

@keyframes page-off {
  to {
    transform: translateX(100%);
  }
}

@keyframes page-back {
  from {
    transform: translateX(-30%);
    filter: brightness(0.6);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pulse,
  .fade,
  .screen > *,
  .bubble-row--new,
  .typing__dot,
  .notif--newest,
  .toast {
    animation: none;
  }

  .lock__stack.is-collapsed .notif,
  .toast {
    transition: none;
  }

  * {
    transition-duration: 1ms !important;
  }
}

/* ============================ SHELL ============================ */

/* Exactly the visible viewport, and the handset takes whatever the caption
   leaves of it. A fixed share of `vh` measured the viewport with the browser's
   toolbars hidden, so on a phone the frame, the padding and the caption came
   to more than the screen: the page scrolled, and every app's own scroller
   scrolled inside it. `dvh` follows the toolbars; `vh` is the fallback for a
   browser without it. */
.stage {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(18px, env(safe-area-inset-top)) 12px
    max(18px, env(safe-area-inset-bottom));
}

/* Netlify's badge (badge.js) holds the bottom-right corner over everything:
   a 38px pill 18px in from both edges, taking taps from 13 to 61px above the
   bottom edge and up to 194px in from the right. Where the foot of a screen
   is narrow enough to run under it, the foot rises clear of it instead: the
   handset's column, 392px centred, meets it below 780px. */
:root.has-host-badge {
  --host-badge-clear: 72px;
}

@media (max-width: 800px) {
  .has-host-badge .stage {
    padding-bottom: max(var(--host-badge-clear), env(safe-area-inset-bottom));
  }
}

.frame {
  width: 392px;
  max-width: 100%;
  flex: 1;
  min-height: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 34px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
  position: relative;
  /* So the wallpaper below can sit under the status bar and the screen
     without going under the frame's own background. */
  isolation: isolate;
}

/* ---- wallpaper ----

   Her photo, because it is her phone: rain on the Nordnes window at three in
   the morning, one streetlamp, the recorder on the sill (Glimt's `window`).
   Only the lock screen and the home screen show it; an app covers it, the
   way an app does. Locked, it is the photo. Unlocked, it falls back behind
   the icons — blurred, darker, a little closer — and that move is the
   unlock. The scrim keeps the status bar and the foot of the screen legible
   whatever the photo is doing behind them. */
.frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(5, 7, 10, 0.62), rgba(5, 7, 10, 0) 16%, rgba(5, 7, 10, 0) 58%, rgba(5, 7, 10, 0.72)),
    linear-gradient(rgba(5, 7, 10, 0.32), rgba(5, 7, 10, 0.32)),
    var(--wallpaper) 50% 40% / cover no-repeat;
  --wallpaper: url("assets/glimt/mira-window.jpg");
  /* Hidden, it waits as the home screen shows it, so leaving an app only
     fades it in. Hidden sharp, it would fade in sharp and blur a beat later:
     the photo flashing in focus behind the icons. Only the lock screen
     brings it into focus. */
  opacity: 0;
  filter: blur(14px) brightness(0.58) saturate(0.7);
  transform: scale(1.08);
  transition: opacity var(--t-slow) var(--ease), filter var(--t-page) var(--ease-page),
    transform var(--t-page) var(--ease-page);
}

@supports (background-image: image-set(url("x.avif") type("image/avif"))) {
  .frame::before {
    --wallpaper: image-set(url("assets/glimt/mira-window.avif") type("image/avif"),
        url("assets/glimt/mira-window.jpg") type("image/jpeg"));
  }
}

.frame:has(.lock)::before {
  opacity: 1;
  filter: none;
  transform: none;
}

/* Desaturated as well as dimmed (the look `.frame::before` keeps while
   hidden): the streetlamp, blurred, is a warm patch behind the icons, and
   orange on this screen belongs to the badges. The home bar's swipe
   (ui/homebar.js) brings it up behind the app it lifts. */
.frame:has(.home)::before,
.frame.is-going-home::before {
  opacity: 1;
}

/* The global reduced-motion rule reaches elements, not pseudo-elements. */
@media (prefers-reduced-motion: reduce) {
  .frame::before {
    transition: none;
  }
}

/* ---- device: the frame plus the hardware hung off it ---- */

.device {
  position: relative;
  width: 392px;
  max-width: 100%;
  /* As tall as a handset, and shorter when the screen is. */
  flex: 0 1 830px;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.device__lock {
  position: absolute;
  top: 148px;
  right: -3px;
  width: 4px;
  height: 62px;
  padding: 0;
  border: none;
  border-radius: 0 3px 3px 0;
  background: var(--line);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}

.device__lock::before {
  /* the real tap target, wider than the sliver you can see */
  content: "";
  position: absolute;
  inset: -12px -14px -12px -10px;
}

.device__lock:disabled {
  opacity: 0.4;
  cursor: default;
}

/* The ring/silent switch: left edge, above where the volume buttons would be.
   A short sliver like the lock button, and orange when it is set to silent. */
.device__silent {
  position: absolute;
  top: 118px;
  left: -3px;
  width: 4px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 3px 0 0 3px;
  background: var(--line);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.device__silent::before {
  content: "";
  position: absolute;
  inset: -12px -10px -12px -14px;
}
.device__silent.is-silent {
  background: var(--live);
}

.caption {
  flex-shrink: 0;
  color: var(--dimmer);
  font-size: 11.5px;
  margin: 12px 0 0;
  text-align: center;
  max-width: 392px;
  line-height: 1.45;
  /* main.js pins the old height and moves to the new one when a line wraps
     differently, so the handset above eases rather than jumps. */
  overflow: hidden;
  transition: height var(--t-slow) var(--ease);
}

/* A hint is the caption speaking up after minutes of nothing (engine/hints.js).
   Warmer and a touch brighter than the act line, so it reads as said rather
   than labelled, and it arrives rather than appears. */
.caption--hint {
  color: var(--text);
  animation: fade var(--t-slow) var(--ease) both;
}

/* A puzzle solved (main.js, `won` in content/sections.js): Harbour Steel, for
   the few seconds it is said, and it arrives the way a hint does. */
.caption--won {
  color: var(--cool);
  animation: fade var(--t-slow) var(--ease) both;
}

/* The hint button (engine/hints.js): the notes' pill, filling left to right
   with a Harbour Steel wash while the hint clock runs, the way the battery
   climbs on a wire. Only a full pill can be pressed. The fill moves once a
   second, so it eases linearly across each second rather than stepping.

   The row also holds the way back to the title screen, so it is always
   there. The pill keeps its place while no hint is in force, so nothing
   beside it moves as the story does; it only goes at the end. */
.hintrow {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}
.hintbtn.is-off {
  visibility: hidden;
}
.hintbtn[hidden] {
  display: none;
}
.hintbtn {
  --p: 0;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 32px;
  min-width: 92px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dim);
  font: inherit;
  font-size: 11.5px;
  line-height: 1;
  padding: 0 16px;
  cursor: default;
  transition: color var(--t-slow) var(--ease),
    border-color var(--t-slow) var(--ease);
}
.hintbtn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(111, 168, 199, 0.16);
  transform-origin: left;
  transform: scaleX(var(--p));
  transition: transform 1s linear, background-color var(--t-slow) var(--ease);
}
/* The leading edge, so a slow fill still reads as moving. */
.hintbtn::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--p) * 100%);
  width: 1px;
  background: var(--cool);
  opacity: 0.7;
  transition: left 1s linear;
}
.hintbtn.is-ready {
  color: var(--text);
  border-color: var(--cool);
  cursor: pointer;
}
.hintbtn.is-ready::before {
  background: var(--cool-wash);
}
.hintbtn.is-ready::after,
.hintbtn.is-done::before,
.hintbtn.is-done::after {
  display: none;
}
.hintbtn.is-done {
  opacity: 0.6;
}
.hintbtn.is-ready:active::before {
  background: rgba(111, 168, 199, 0.16);
}
@media (hover: hover) and (pointer: fine) {
  .hintbtn.is-ready:hover::before {
    background: rgba(111, 168, 199, 0.16);
  }
}
@media (prefers-reduced-motion: reduce) {
  .hintbtn::before,
  .hintbtn::after {
    transition: none;
  }
}

/* Playthrough notes: outside the phone, like the caption, and quieter. */
.notes {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  max-width: 392px;
}
.notes[hidden] {
  display: none;
}
/* The notes and the support pill side by side, wrapping only on a screen
   too narrow for both. */
.notes__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
/* 32px tall, the same as the support pill beside them, so a stack of them
   reads as one set and each takes a thumb. */
.notes__btn,
.reload {
  min-height: 32px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dim);
  font: inherit;
  font-size: 11.5px;
  line-height: 1;
  padding: 0 14px;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease);
}
/* A newer build is live (build.js). The notes' pill, a step brighter: it is
   news, not a standing offer. */
.reload {
  flex-shrink: 0;
  margin-top: 8px;
  border-color: var(--line-hi);
  color: var(--cool);
}
.reload[hidden] {
  display: none;
}
/* Support the dev (ui/support.js) and About me (ui/about.js): the notes'
   pill with a drawn mark in it. Never Sodium Lamp — each is an offer, not a
   live thing. Tall enough to take a thumb on a phone. */
.support,
.about-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dim);
  font: inherit;
  font-size: 11.5px;
  line-height: 1;
  padding: 0 14px 0 11px;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    background-color var(--t-fast) var(--ease);
}
.support[hidden] {
  display: none;
}
.support .icon,
.about-btn .icon {
  width: 15px;
  height: 15px;
  stroke-width: 1.7;
}
.support:active,
.about-btn:active {
  background: var(--panel);
}
@media (hover: hover) and (pointer: fine) {
  .support:hover,
  .about-btn:hover {
    color: var(--text);
    border-color: var(--line-hi);
  }
}
/* Copied: the caption says so, and the pill holds Harbour Steel while it
   does — over its own hover, which is where the pointer still is. */
.notes .notes__btn.is-done {
  color: var(--cool);
  border-color: var(--cool);
}
.notes__done {
  color: var(--dimmer);
  font-size: 11px;
  text-align: center;
}
.notes__text {
  width: min(392px, 90vw);
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 11px;
  padding: 8px;
}

.screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---- status bar ---- */

.statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px 8px;
  font-size: 12px;
  flex-shrink: 0;
}

.statusbar__left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.statusbar__clock {
  font-family: var(--mono);
  letter-spacing: 0.04em;
}

/* Where you are standing. It is one word tonight; travel is what makes it
   worth the room. */
.statusbar__where {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  color: var(--dim);
  min-width: 0;
}

.statusbar__where .icon {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

.statusbar__where span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statusbar__right {
  display: flex;
  align-items: center;
  gap: 7px;
}

.statusbar__rec {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--live);
  font-family: var(--mono);
  font-size: 10px;
}

.statusbar__dot {
  width: 6px;
  height: 6px;
  border-radius: 6px;
  background: var(--live);
  display: inline-block;
}

.statusbar__net {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
}

/* Shown only while the wire is in; main.js owns the display. Cool, not live:
   it is a fact about the hardware and not a warning about it, and it is the
   one thing in this status bar that is good news. */
.statusbar__bolt {
  width: 6px;
  height: 10px;
  background: var(--cool);
  clip-path: var(--bolt);
}

.statusbar__pct {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--live);
}

.battery {
  width: 22px;
  height: 11px;
  border: 1px solid var(--dim);
  border-radius: 3px;
  display: inline-block;
  padding: 1px;
}

/* Scaled rather than resized: animating width on this would relayout the
   status bar every tick of the drain. */
.battery__fill {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--live);
  border-radius: 1px;
  transform-origin: left center;
  transition: transform 600ms var(--ease), background-color 600ms var(--ease);
}

/* Text takes the colour; only the fill takes it as a background. Sharing one
   rule painted the percentage red on red and made it vanish. */
.statusbar__pct.is-critical {
  color: #d9534a;
}

.battery__fill.is-critical {
  background: #d9534a;
}

/* ---- bottom bar ---- */

.bottombar {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* The visible pill is 118x4, but the tap target is the whole strip —
   4px of button is not something you can hit on a phone. It takes a drag
   as well as a tap (ui/homebar.js), so the browser must not take the
   pointer for a scroll. */
.bottombar__home {
  width: 200px;
  height: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The app the home bar's swipe is carrying off: a card with the screen's
   own Blackwater behind it, so the wallpaper coming up underneath never
   shows through its text, shrinking towards the thumb. `--lift` runs 0 to
   1 over the first few pixels of the drag (ui/homebar.js): the corners
   round and the shadow comes up as it starts to move, rather than the flat
   app snapping into a card. Registered, so it can transition with the
   card when it settles back or is carried off. */
@property --lift {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

.screen > .is-lifting {
  background: var(--bg);
  border-radius: calc(28px * var(--lift));
  overflow: hidden;
  transform-origin: 50% 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, calc(0.55 * var(--lift)));
}

.bottombar__home::after {
  content: "";
  width: 118px;
  height: 4px;
  border-radius: 4px;
  background: var(--line);
  transition: background 0.15s ease;
}

.bottombar__home:hover::after,
.bottombar__home:active::after {
  background: var(--dim);
}

.bottombar__home:focus-visible {
  outline: none;
}

.bottombar__home:focus-visible::after {
  background: var(--cool);
}

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

/* ============================ COLD OPEN ============================ */

/* The story in the middle of the screen and the two offers at its foot.
   The height is the viewport's, not 100%: #root only has a min-height, so a
   percentage of it resolved to nothing and the story sat at the top. */
.coldopen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 12px max(20px, env(safe-area-inset-bottom));
}

.coldopen__inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 460px;
  padding: 0 28px;
  line-height: 1.65;
}

/* It arrives the way it reads: the find, then the excuse, then a beat before
   the last line. Short enough that a returning player is never kept from the
   button. */
.coldopen__inner > *,
.coldopen__more {
  animation: cold-in 700ms var(--ease) both;
}

.coldopen__inner > :nth-child(2) {
  animation-delay: 120ms;
}

.coldopen__inner > :nth-child(3) {
  animation-delay: 300ms;
}

.coldopen__inner > :nth-child(4) {
  animation-delay: 650ms;
}

.coldopen__inner > :nth-child(n + 5),
.coldopen__more {
  animation-delay: 820ms;
}

@keyframes cold-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .coldopen__inner > *,
  .coldopen__more {
    animation: none;
  }
}

.coldopen__title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.34em;
  color: var(--live);
  margin-bottom: 28px;
}

.coldopen p {
  margin: 0 0 18px;
  font-size: 17px;
}

.coldopen p.muted {
  color: var(--dim);
}

/* Side by side, the way back in the wider of the two. They stack only on a
   phone too narrow to hold both labels. */
.coldopen__actions {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.coldopen__actions .btn {
  flex: 1 1 140px;
  width: auto;
  padding-inline: 12px;
}

.coldopen__actions .btn:first-child {
  flex-grow: 1.4;
}

/* Armed: one more press erases the save, and it says so in the colour the
   battery uses for the end of its charge. */
.coldopen__actions .btn--ghost.is-armed,
.coldopen__actions .btn--ghost.is-armed:hover {
  color: #d9534a;
  border-color: #d9534a;
}

.coldopen__resume {
  font-size: 11.5px;
  color: var(--dimmer);
  margin-top: 14px;
  text-align: center;
}

.coldopen__more {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}

/* About me and Support the dev, 236px centred, run under Netlify's badge
   below 624px (see .stage). */
@media (max-width: 640px) {
  .has-host-badge .coldopen {
    padding-bottom: max(var(--host-badge-clear), env(safe-area-inset-bottom));
  }
}

/* ============================ LOCK ============================ */

.lock {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.lock__clock {
  text-align: center;
  margin-top: 54px;
}

/* Both sit on her photo, so they carry a shadow the way a lock screen's
   lettering does: dark and close, never a glow. The date is lifted off --dim,
   which disappears into the rain. */
.lock__time {
  font-family: var(--mono);
  font-size: 62px;
  letter-spacing: -0.03em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

.lock__date {
  font-size: 13px;
  color: var(--text);
  opacity: 0.82;
  margin-top: 2px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.lock__spacer {
  flex: 1;
}

.lock__stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 18px;
  flex-shrink: 0;
}

/* ---- collapsed pile ----

   The group behaves the way a phone's does: the newest card sits fully
   visible nearest the thumb and the ones behind it peek out above, narrower
   and dimmer, so the pile reads as depth rather than as a list. */

.lock__stack.is-collapsed {
  position: relative;
  display: block;
  height: 118px;
}

.lock__stack.is-collapsed .notif {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 24px;
  /* The base rule sets width:100%, and a width beats `right` on an absolutely
     positioned box — leaving every card the full width of the stack and
     hanging off the edge of the phone. */
  width: auto;
  transform: translateY(calc(var(--depth) * -9px)) scale(calc(1 - var(--depth) * 0.05));
  z-index: calc(10 - var(--depth));
  transition: transform var(--t-med) var(--ease), opacity var(--t-med) var(--ease);
}

/* Only the front card's text is readable; the rest are edges. Keyed on a
   class rather than the inline custom property, which browsers are free to
   serialise however they like. */
.lock__stack.is-collapsed .notif:not(.notif--front) .notif__prev,
.lock__stack.is-collapsed .notif:not(.notif--front) .notif__from {
  visibility: hidden;
}

.lock__count {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: none;
  border: none;
  padding: 4px 0 0;
  font-size: 11px;
  color: var(--dimmer);
  cursor: pointer;
  transition: color var(--t-fast) var(--ease);
}

.lock__more {
  font-size: 11px;
  color: var(--dimmer);
  text-align: center;
  padding-bottom: 2px;
}

.notif {
  --depth: 0;
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  cursor: pointer;
  /* newest is depth 0 and sits nearest the thumb; the pile recedes upward */
  opacity: calc(1 - var(--depth) * 0.18);
  transform: scale(calc(1 - var(--depth) * 0.016));
  transform-origin: 50% 100%;
  transition: background var(--t-fast) var(--ease), opacity var(--t-med) var(--ease);
}

.notif--newest {
  animation: notif-in var(--t-slow) var(--ease) both;
}

@keyframes notif-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
}

.notif__app {
  display: flex;
  align-items: center;
  gap: 6px;
}

.notif__app .icon,
.toast__app .icon {
  width: 13px;
  height: 13px;
}

.notif__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.notif__app {
  display: flex;
  align-items: center;
  gap: 6px;
}

.notif__app .icon {
  width: 13px;
  height: 13px;
}

.notif__from {
  font-size: 14px;
  font-weight: 600;
  margin-top: 5px;
}

.notif__prev {
  font-size: 13px;
  color: var(--dim);
  margin-top: 3px;
}

.lock__foot {
  padding-top: 6px;
  flex-shrink: 0;
}

/* The home indicator is hidden while locked, so the bottom bar is reserving
   38px of nothing and pushing the swipe bar up off the edge. Collapse it for
   the lock screen only — `:has` keeps this in CSS instead of another class
   toggle threaded through the shell. The swipe bar draws its own indicator in
   the same place. */
.frame:has(.lock) .bottombar {
  height: 0;
}

/* ============================ HOME ============================ */

/* The grid scrolls; the dock does not. */
.home {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.home__page {
  flex: 1;
  min-height: 0;
  padding: 34px 26px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* A tray of the bezel's own colour, let partway through to the wallpaper.
   Its inset plus its padding is the grid's 26px, so its outer icons line up
   with the grid's edges; four to a row, as a dock holds. The corner is the
   icon's 17px plus the 12px around it. */
.dock {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: 8px;
  justify-items: center;
  margin: 0 14px 4px;
  padding: 12px;
  border-radius: 29px;
  border: 1px solid var(--line);
  background: rgba(20, 25, 32, 0.62);
}

.home__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px 8px;
}

.appbtn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 0;
}

.appbtn__icon {
  width: 58px;
  height: 58px;
  border-radius: 17px;
  background: var(--panel);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cool);
  position: relative;
}

.icon {
  width: 26px;
  height: 26px;
  display: block;
}

/* The detail you read second. Below ~0.5 it stops reading at 26px. */
.icon__accent {
  opacity: 0.5;
}

.appbtn__label {
  font-size: 11px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  border-radius: 10px;
  background: var(--live);
  color: #0b0e12;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================ SHARED APP CHROME ============================ */

.pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.scroller {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.appheader {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 20px 10px;
  flex-shrink: 0;
}

.appheader__title {
  font-size: 15px;
  font-weight: 600;
}

.appheader__right {
  font-size: 12px;
  color: var(--dim);
  font-family: var(--mono);
}

/* The chevron is drawn (icons.js), so it centres on the label instead of
   riding the font baseline the way the ‹ character did. */
.backbar__chev {
  display: inline-flex;
  margin: 0 6px 0 -4px;
  transition: transform var(--t-fast) var(--ease);
}

.backbar__chev .icon {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.backbar {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  background: var(--chrome);
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 12px 18px;
  color: var(--cool);
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

.row {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 13px 20px;
  cursor: pointer;
}

.row__top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.row__name {
  font-weight: 600;
  font-size: 14px;
}

.row__name.hot {
  color: var(--live);
}

.row__when {
  font-size: 11px;
  color: var(--dimmer);
  white-space: nowrap;
  font-family: var(--mono);
}

.row__prev {
  font-size: 12.5px;
  color: var(--dim);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hint {
  font-size: 11.5px;
  color: var(--dimmer);
  letter-spacing: 0.02em;
}

.btn {
  width: 100%;
  background: var(--live);
  border: 1px solid transparent;
  border-radius: 12px;
  color: #0b0e12;
  padding: 12px 16px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
}

.btn--ghost {
  background: none;
  border: 1px solid var(--line);
  color: var(--dim);
  padding: 11px 16px;
  font-size: 13.5px;
  font-weight: 400;
}

.btn--end {
  background: #8e3b30;
  color: #f4e6e2;
}

.btn--tiny {
  width: auto;
  padding: 5px 10px;
  font-size: 11px;
  border-radius: 8px;
}

.field {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  font-family: var(--sans);
  outline: none;
}

.field__label {
  display: block;
  font-size: 12px;
  color: var(--dim);
  margin: 14px 0 6px;
}

/* ============================ MESSAGES ============================ */

/* Room under the last bubble, so it does not sit hard on the reply tray. */
.thread {
  padding-top: 8px;
  padding-bottom: 16px;
}

.bubble-row {
  display: flex;
}

.bubble-row--me {
  justify-content: flex-end;
}

.bubble {
  max-width: 76%;
  padding: 9px 13px;
  border-radius: 17px;
  margin: 1px 18px;
  font-size: 14.5px;
  line-height: 1.5;
  background: var(--panel2);
  border-bottom-left-radius: 5px;
}

.bubble--me {
  background: var(--me);
  border-bottom-left-radius: 17px;
  border-bottom-right-radius: 5px;
}

/* A run of messages from one sender is one group: 2px apart inside it, a
   wider gap where the sender changes, and the tail only on the last bubble
   of the run. "Last" means the next thing in the thread is not theirs too,
   and their typing dots count as theirs, so the tail moves down as they
   write. */
.bubble-row:not(.bubble-row--me) + .bubble-row--me,
.bubble-row--me + .bubble-row:not(.bubble-row--me),
.bubble-row--me + .bubble:not(.bubble--me) {
  margin-top: 8px;
}
.bubble-row:not(.bubble-row--me):has(+ .bubble-row:not(.bubble-row--me)) .bubble,
.bubble-row:not(.bubble-row--me):has(+ .bubble:not(.bubble--me)) .bubble {
  border-bottom-left-radius: 17px;
}
.bubble-row--me:has(+ .bubble-row--me) .bubble {
  border-bottom-right-radius: 17px;
}

.bubble__stamp {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dimmer);
  margin-top: 4px;
}

.tray {
  border-top: 1px solid var(--line);
  padding: 10px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: var(--chrome);
  flex-shrink: 0;
}

.tray--dead {
  display: block;
  color: var(--dimmer);
  font-size: 12px;
}

.choice {
  background: none;
  border: 1px solid var(--cool);
  color: var(--cool);
  border-radius: 18px;
  padding: 9px 14px;
  font-size: 13.5px;
  cursor: pointer;
  text-align: left;
}

/* The silence above a woken thread. Sixteen days of him getting no answer sit
   at the top of his thread; this is the seam, with a rule either side of the
   line so it reads as a gap in time rather than as another message. */
.thread__gap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 4px 8px;
}

.thread__gap::before,
.thread__gap::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.thread__end {
  text-align: center;
  padding: 26px 20px 6px;
}

/* ============================ BROWSER ============================ */

.urlbar {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: var(--chrome);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.urlbar__input {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 8px 11px;
  font-size: 13px;
  font-family: var(--mono);
  outline: none;
}

/* Back, where a phone's browser keeps it: left of the address. Square, so
   it reads as a control rather than a second field. */
.urlbar__back {
  flex-shrink: 0;
  width: 38px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--cool);
  border-radius: 10px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.urlbar__back .icon {
  width: 20px;
  height: 20px;
  stroke-width: 1.8;
}

.urlbar__go {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--cool);
  border-radius: 10px;
  padding: 0 13px;
  font-size: 13px;
  cursor: pointer;
}

.web {
  background: #0e1217;
}

.page {
  padding: 20px 22px 40px;
}

.page__url {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
}

.page h2 {
  font-size: 21px;
  margin: 10px 0 8px;
  font-weight: 600;
}

.page p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--dim);
  margin: 0 0 14px;
}

.page pre {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  white-space: pre-wrap;
  margin: 0 0 14px;
}

.page__link {
  display: block;
  background: none;
  border: none;
  padding: 8px 0;
  color: var(--cool);
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-align: left;
}

.page__hist {
  font-size: 13px;
  color: var(--dim);
  padding: 6px 0;
  font-family: var(--mono);
}

.page__err {
  color: var(--live);
  font-size: 12px;
  margin-top: 10px;
}

/* ---- search results ----

   A result that goes somewhere is a button and a result that does not is a
   div, and the difference has to be visible without a chrome affordance: the
   dead ones simply do not take the pointer or the hover. */
.page__result {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-top: 1px solid var(--line);
  padding: 14px 0;
  color: inherit;
  font: inherit;
}

button.page__result {
  cursor: pointer;
}

.page__result-title {
  font-size: 14px;
  color: var(--cool);
}

div.page__result .page__result-title {
  color: var(--dim);
}

.page__result-url {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--dimmer);
  margin-top: 3px;
}

.page__result-snip {
  font-size: 12.5px;
  color: var(--dim);
  line-height: 1.5;
  margin-top: 6px;
}

/* A condolence on a memorial page. Quoted rather than styled as body copy,
   because it is the one sentence on that page the player can actually read. */
.page__quote {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
  border-left: 2px solid var(--line-hi);
  padding-left: 12px;
}

.page__quote-by {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--dimmer);
  padding-left: 14px;
  margin-top: 8px;
}

@media (hover: hover) and (pointer: fine) {
  button.page__result:hover .page__result-title {
    color: var(--text);
  }
}

.page table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
}

.page td.k {
  padding: 7px 0;
  color: var(--dim);
  vertical-align: top;
  width: 45%;
}

.page td.v {
  padding: 7px 0;
  color: var(--text);
}

/* ============================ RECORDINGS ============================ */

.rec__head {
  padding: 16px 20px 12px;
  flex-shrink: 0;
}

.rec__title {
  font-size: 15px;
  font-weight: 600;
}

.rec__meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  margin-top: 3px;
}

/* The file, and over it the same bars in Sodium Lamp uncovered up to the
   playhead (recorder.js moves both). */
.wave {
  position: relative;
  height: 60px;
  margin-top: 16px;
}

.wave__bars {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}

.wave__bar {
  flex: 1;
  border-radius: 1px;
  display: block;
  background: var(--line);
}

.wave__bars--played {
  clip-path: inset(0 100% 0 0);
}

.wave__bars--played .wave__bar {
  background: var(--live);
}

/* The playhead: a Paper Grey hairline a little taller than the loudest bar,
   kept out of the way until the file has been started. */
.wave__head {
  position: absolute;
  top: -4px;
  bottom: -4px;
  left: 0;
  width: 2px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--text);
  pointer-events: none;
}

.wave.is-idle .wave__head {
  opacity: 0;
}

.rec__times {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dimmer);
}

.rec__times .live {
  color: var(--live);
}

.rec__controls {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.rec__controls .btn--ghost {
  width: 96px;
  flex-shrink: 0;
}

.rec__transcript {
  border-top: 1px solid var(--line);
}

/* On the baseline, not the top: the timecode is smaller and set tighter than
   the line it marks, so top-aligned it rode above the words. */
.trans-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 8px 20px;
}

.trans-row__tc {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dimmer);
  min-width: 42px;
}

.trans-row__text {
  font-size: 13.5px;
  line-height: 1.55;
}

/* ============================ MAPS ============================ */

.map {
  position: relative;
  height: 372px;
  flex-shrink: 0;
  background: #070c11;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  /* A drag is a pan. Without this it also selects every label it crosses. */
  user-select: none;
  -webkit-user-select: none;
}

.map.is-grabbing {
  cursor: grabbing;
}

.map__svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Every stroke is a hairline at every zoom. Without this the coastline turns
   into a fat crayon line the moment you zoom in. */
.map__svg path,
.map__svg line {
  vector-effect: non-scaling-stroke;
}

.geo__sea {
  fill: #060a0e;
}

/* A graticule is background information: present enough to say "this is a
   map", never competing with the coastline in front of it. */
/* Drawn above the geography and the fog, so it has to be quiet enough to sit
   on top of land without reading as a fence. */
.grat line {
  stroke: #1b2732;
  stroke-width: 1;
  opacity: 0.5;
}

/* Land has to read against water at a glance, so the step from sea to shore
   is the biggest jump in the whole palette. The shallows sit between them and
   are what stop the coastline looking cut out with scissors. */
.geo__shallow path {
  fill: #0a141c;
  stroke: none;
}

.geo__land path {
  fill: #1a252e;
  stroke: #3d5164;
  stroke-width: 1.2;
  stroke-linejoin: round;
}

.geo__hill path {
  fill: #212e39;
  stroke: #2b3a47;
  stroke-width: 0.8;
}

.geo__peak path {
  fill: #293845;
  stroke: none;
}

.geo__road path {
  fill: none;
  stroke: #4a5c6b;
  stroke-width: 1.4;
  stroke-linecap: round;
  opacity: 0;
  transition: opacity var(--t-med) var(--ease);
}

.map.is-close .geo__road path {
  opacity: 1;
}

/* ---- detail: none of it named, all of it quieter than the roads ----

   Built-up ground lifts whatever it sits on by a step, the way a chart
   tints a town: translucent, because the city climbs the hill tiers and a
   flat fill read as a hole in them. Streets are lighter than the ground,
   like the roads. Lakes are the shallows' water with a finer shore than
   the coast's. Minor roads and streams come in with the labels; streets
   and houses only close in (maps.js, STREET_ZOOM), where a block is a few
   pixels across rather than a hatch. */

.geo__built path {
  fill: rgba(150, 172, 192, 0.07);
  stroke: rgba(150, 172, 192, 0.14);
  stroke-width: 0.6;
  stroke-linejoin: round;
}

.geo__lake path {
  fill: #0a141c;
  stroke: #33475a;
  stroke-width: 0.8;
  stroke-linejoin: round;
}

.geo__stream path,
.geo__minor path,
.geo__street path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity var(--t-med) var(--ease);
}

.geo__stream path {
  stroke: #24394b;
  stroke-width: 0.8;
}

.geo__minor path {
  stroke: #3e4d5a;
  stroke-width: 1;
}

.geo__street path {
  stroke: rgba(150, 172, 192, 0.2);
  stroke-width: 0.7;
}

.geo__house path {
  fill: #3a4855;
  stroke: none;
  opacity: 0;
  transition: opacity var(--t-med) var(--ease);
}

.map.is-close .geo__stream path,
.map.is-close .geo__minor path,
.map.is-near .geo__street path,
.map.is-near .geo__house path {
  opacity: 1;
}

.geo__ferry {
  fill: none;
  stroke: #3b5160;
  stroke-width: 1.2;
  stroke-dasharray: 5 6;
  stroke-linecap: round;
}

/* ---- pins: positioned in screen space, so they never scale ---- */

.pin {
  cursor: pointer;
}

.pin.is-hidden {
  display: none;
}

.pin__halo {
  fill: var(--cool);
  opacity: 0.1;
  transition: opacity var(--t-fast) var(--ease);
}

.pin__dot {
  fill: var(--cool);
  stroke: #070c11;
  stroke-width: 2;
  transition: fill var(--t-fast) var(--ease), r var(--t-fast) var(--ease);
}

.pin__label {
  fill: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
  text-anchor: middle;
  paint-order: stroke;
  stroke: #070c11;
  stroke-width: 3;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity var(--t-med) var(--ease);
  pointer-events: none;
}

.map.is-close .pin__label,
.pin.is-selected .pin__label {
  opacity: 1;
}

/* Dropped by the collision pass. A selected pin always keeps its label. */
.pin.label-clash:not(.is-selected) .pin__label {
  opacity: 0;
}

.pin.is-selected .pin__dot {
  fill: var(--live);
  r: 7;
}

.pin.is-selected .pin__halo {
  fill: var(--live);
  opacity: 0.22;
}

/* ---- hud ---- */

.map__hud {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 9px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.map__scale {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dimmer);
}

/* No transition: this is written on every frame of a zoom, and a transition
   would make the bar lag behind the map it is measuring. */
.map__scale-rule {
  height: 5px;
  border: 1px solid var(--dimmer);
  border-top: none;
}

.map__coords {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dimmer);
  text-align: right;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .geo__road path,
  .geo__stream path,
  .geo__minor path,
  .geo__street path,
  .geo__house path,
  .pin__label {
    transition: none;
  }
}

.place {
  padding: 16px 20px;
}

.place__coords {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--dim);
}

.place__name {
  font-size: 16px;
  font-weight: 600;
}

.place__sub {
  font-size: 12px;
  color: var(--dim);
  margin-top: 3px;
}

.place__detail {
  font-size: 13.5px;
  margin-top: 14px;
  white-space: pre-line;
  line-height: 1.6;
}

.place .btn {
  margin-top: 18px;
}

.place .btn--ghost {
  margin-top: 8px;
}

/* ============================ PHONE ============================ */

.dial {
  padding: 4px 20px 10px;
  flex-shrink: 0;
}

.dial__num {
  font-family: var(--mono);
  font-size: 18px;
  text-align: center;
  letter-spacing: 0.05em;
}

.dial__pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

/* A fixed height and flex centring, so a drawn key (the erase) is the same
   size as a typed one and both sit in the middle of the key. */
.dial__key {
  position: relative;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  font-size: 17px;
  line-height: 1;
  font-family: var(--mono);
  cursor: pointer;
}

.dial__key > .icon {
  width: 22px;
  height: 22px;
}

/* The voicemail glyph under the 1, where a keypad prints its letters. Set
   off the flow so the 1 is the same height as every other key. */
.dial__sub {
  position: absolute;
  left: 50%;
  bottom: 3px;
  transform: translateX(-50%);
  color: var(--dimmer);
  line-height: 0;
}

.dial__sub .icon {
  width: 14px;
  height: 14px;
}

.dial .btn {
  margin-top: 12px;
}

.dial__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.dial__actions .btn {
  flex: 1;
  margin-top: 0;
}

.dial__actions .dial__vm {
  flex: 0 0 auto;
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.dial__vm .icon {
  width: 18px;
  height: 18px;
}

.call {
  padding: 0 22px;
}

.call__head {
  text-align: center;
  padding: 30px 0 6px;
}

.call__who {
  font-size: 19px;
  font-weight: 600;
}

.call__state {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--live);
  margin-top: 4px;
}

.call__lines {
  padding: 12px 0;
}

.call__row {
  font-size: 14px;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.call__count {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--dimmer);
}

.call__line {
  font-size: 14.5px;
  line-height: 1.6;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
}

.call .btn--end {
  margin-bottom: 20px;
}

/* ============================ NOTES ============================ */

.note {
  padding: 16px 22px;
}

.note__title {
  font-size: 16px;
  font-weight: 600;
}

.note__meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dimmer);
  margin-top: 4px;
}

.note__body {
  white-space: pre-line;
  font-size: 14.5px;
  line-height: 1.7;
  margin-top: 16px;
}

/* ============================================================
   INTERACTION STATES

   The handset is cold hardware that answers reluctantly. A hover
   lifts a surface one step toward backlit; it never glows. Orange
   stays reserved for live/threat and is never spent on feedback
   for an ordinary control.

   Transitions live on the base selector so a control settles back
   as deliberately as it lit up.
   ============================================================ */

.btn,
.row,
.choice,
.backbar,
.dial__key,
.urlbar__back,
.urlbar__go,
.page__link,
.field,
.urlbar__input,
.appbtn__icon,
.wave__bar {
  transition: background-color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease);
}

/* ---- pressed: unguarded, touch needs this too ---- */

.btn:not(:disabled):active {
  background: #d06f30;
  transform: scale(0.99);
}

.btn--ghost:not(:disabled):active {
  background: var(--panel);
  transform: scale(0.99);
}

.btn--end:not(:disabled):active {
  background: #7a3229;
}

.row:active {
  background: var(--panel2);
}

.choice:active {
  background: rgba(111, 168, 199, 0.16);
  transform: scale(0.99);
}

.appbtn:active .appbtn__icon {
  transform: scale(0.94);
  background: var(--panel2-hi);
}

.dial__key:active {
  background: var(--panel2-hi);
  border-color: var(--line-hi);
  transform: scale(0.94);
}

.backbar:active {
  background: var(--panel2);
}

.urlbar__back:not(:disabled):active,
.urlbar__go:not(:disabled):active {
  background: var(--panel2);
}

/* ---- disabled: an inert control must look inert ---- */

.btn:disabled {
  background: var(--panel);
  border-color: var(--line);
  color: var(--dimmer);
  font-weight: 400;
}

.btn--ghost:disabled {
  background: none;
  color: var(--dimmer);
}

.urlbar__back:disabled,
.urlbar__go:disabled {
  color: var(--dimmer);
  background: var(--panel);
}

/* ---- fields ---- */

.field:focus,
.urlbar__input:focus {
  border-color: var(--cool);
  background: var(--panel2);
}

/* The ring goes inside. A field already has an edge to light, and most of
   them sit flush in a scroller — the code prompt in a call, the forms on a
   page — whose overflow cuts an outset outline off at both sides. The cool
   border plus one more pixel inside it is the same 2px ring as everywhere
   else, drawn where nothing can clip it. */
.field:focus-visible,
.urlbar__input:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1px var(--cool);
}

/* ---- the live thread: the one authored moment ---- */

.bubble-row--new .bubble {
  animation: bubble-in var(--t-slow) var(--ease) both;
  transform-origin: 0 100%;
}

.bubble-row--new.bubble-row--me .bubble {
  transform-origin: 100% 100%;
}

@keyframes bubble-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.bubble--me .bubble__stamp {
  color: var(--dim-on-me);
}

.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 1.5em;
}

.typing__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--dim);
  animation: typing 1.25s ease-in-out infinite;
}

.typing__dot:nth-child(2) {
  animation-delay: 0.16s;
}

.typing__dot:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    opacity: 0.28;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

/* ---- hover: pointer devices only, so touch never sticks ---- */

@media (hover: hover) and (pointer: fine) {
  .btn:not(:disabled):hover {
    background: var(--live-hi);
  }

  .btn--ghost:not(:disabled):hover {
    background: none;
    border-color: var(--line-hi);
    color: var(--text);
  }

  .btn--end:not(:disabled):hover {
    background: #a04739;
  }

  .row:hover {
    background: var(--panel);
  }

  .row:hover .row__when {
    color: var(--dim);
  }

  .appbtn:hover .appbtn__icon {
    background: var(--panel-hi);
    border-color: var(--line-hi);
    color: #8dc0dc;
  }

  .choice:hover {
    background: var(--cool-wash);
    border-color: #8fc0dc;
    color: #cfe4f0;
  }

  .backbar:hover {
    background: var(--panel);
    color: #8dc0dc;
  }

  .backbar:hover .backbar__chev {
    transform: translateX(-2px);
  }

  .page__link:hover {
    color: #8dc0dc;
    text-underline-offset: 4px;
    text-decoration-thickness: 1.5px;
  }

  .dial__key:hover {
    background: var(--panel-hi);
    border-color: var(--line-hi);
  }

  .set__row--tap:hover {
    background: var(--panel);
  }

  .sheet__act:not(:disabled):hover {
    background: var(--panel);
  }

  .urlbar__back:not(:disabled):hover,
  .urlbar__go:not(:disabled):hover {
    background: var(--panel-hi);
    border-color: var(--line-hi);
    color: #8dc0dc;
  }

  .field:hover,
  .urlbar__input:hover {
    border-color: var(--line-hi);
  }

  .notif:hover {
    background: var(--panel-hi);
  }

  .lock__count:hover {
    color: var(--dim);
  }

  .toast:hover {
    background: rgba(42, 50, 61, 0.95);
  }

  .device__lock:hover,
  .device__silent:not(.is-silent):hover {
    background: var(--line-hi);
  }

  .notes__btn:hover {
    color: var(--text);
    border-color: var(--line-hi);
  }

  .map__pin:hover .map__pin-halo {
    opacity: 0.24;
  }

  .map__pin:hover .map__pin-dot {
    fill: #8dc0dc;
  }
}

/* ============================ BANNER NOTIFICATIONS ============================ */

.toast-host {
  position: absolute;
  top: 8px;
  left: 10px;
  right: 10px;
  height: 0; /* the banners inside are absolute; this is just an anchor */
  z-index: 20;
  pointer-events: none;
}

/* Banners pile the way the lock screen's group does, seen from the other end:
   newest in front, the ones behind peeking out below it, narrower and dimmer.
   Absolute so a new arrival does not shove the others down the screen. */
.toast {
  --depth: 0;
  pointer-events: auto;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: auto;
  text-align: left;
  padding: 11px 13px;
  border-radius: 16px;
  border: 1px solid var(--line-hi);
  background: rgba(33, 40, 50, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  animation: toast-in var(--t-slow) var(--ease) both;
  transform: translateY(calc(var(--depth) * 7px)) scale(calc(1 - var(--depth) * 0.045));
  opacity: calc(1 - var(--depth) * 0.28);
  z-index: calc(10 - var(--depth));
  transition: transform var(--t-med) var(--ease), opacity var(--t-med) var(--ease);
}

/* Only the front banner is read; the rest are edges. */
.toast:not(.toast--front) .toast__body,
.toast:not(.toast--front) .toast__from {
  visibility: hidden;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-14px) scale(0.98);
  }
}

.toast--out {
  animation: toast-out 220ms var(--ease) both;
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(-14px) scale(0.98);
  }
}

.toast__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.toast__app {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toast__from {
  font-size: 13.5px;
  font-weight: 600;
  margin-top: 5px;
}

.toast__body {
  font-size: 13px;
  color: var(--dim);
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================ SETTINGS ============================ */

.set__label {
  padding: 14px 20px 6px;
}

.set__row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}

.set__k {
  color: var(--dim);
}

.set__v {
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
  text-align: right;
}

.set__block {
  padding: 4px 20px 28px;
}

/* The number. A row like the rest, except that it answers a tap, and says
   so the way a handset marks a number it can do something with. */
.set__row--tap {
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
}

.set__row--tap .set__v {
  color: var(--cool);
}

.set__row--tap:focus-visible {
  outline-offset: -2px;
}

.set__row--tap:active {
  background: var(--panel2);
}

/* ---- the sheet a tapped number raises ---- */

.sheet {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 14px 26px;
  background: rgba(5, 7, 10, 0.62);
  animation: sheet-dim var(--t-med) var(--ease) both;
}

.sheet__panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: sheet-up var(--t-slow) var(--ease) both;
}

.sheet__group {
  background: var(--chrome);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.sheet__head {
  padding: 12px 16px 10px;
  text-align: center;
}

.sheet__num {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.05em;
}

.sheet__sub {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--dimmer);
}

.sheet__act {
  display: block;
  width: 100%;
  background: none;
  border: none;
  border-top: 1px solid var(--line);
  padding: 13px 16px;
  font-size: 15px;
  color: var(--cool);
  cursor: pointer;
}

.sheet__act:disabled {
  color: var(--dimmer);
}

.sheet__act:focus-visible {
  outline-offset: -2px;
}

.sheet__act:not(:disabled):active {
  background: var(--panel2);
}

/* Its own card under the group, so it has to win back the border and the
   fill that every other action gives up. */
.sheet__act.sheet__cancel {
  background: var(--chrome);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-weight: 600;
}

@keyframes sheet-dim {
  from {
    opacity: 0;
  }
}

@keyframes sheet-up {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
}

/* Out the way it came in, a little quicker — see dismiss() in ui/parts.js,
   which removes it when this ends. A leaving sheet takes no taps. */
.sheet.is-leaving {
  animation: overlay-out 180ms ease-in both;
  pointer-events: none;
}

.sheet.is-leaving .sheet__panel {
  animation: sheet-down 180ms ease-in both;
}

@keyframes sheet-down {
  to {
    transform: translateY(24px);
    opacity: 0;
  }
}

@keyframes overlay-out {
  to {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sheet,
  .sheet__panel {
    animation: none;
  }
}

.set__note {
  font-size: 13px;
  line-height: 1.6;
  color: var(--dim);
  margin: 0 0 14px;
}

/* ============================ CALENDAR ============================ */

/* A month view. The large title and the weekday letters stay put and the
   weeks scroll under them: seven equal columns, Monday first. The hairline
   runs along the top of each day rather than each week, so a month's first
   row starts its line at the 1st and blank days carry none. */

.cal {
  position: relative;
}

.cal__head {
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
}

.cal__title {
  padding: 12px 16px 8px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.cal__dows,
.cal__week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.cal__dows {
  padding-bottom: 7px;
}

.cal__dows span {
  text-align: center;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}

.cal__dows .is-weekend,
.cal__day.is-weekend .cal__num {
  color: var(--dim);
}

/* Room under the last week for the Today button to float over. */
.cal__scroll {
  position: relative;
  padding-bottom: 72px;
}

.cal__week {
  min-height: 78px;
}

.cal__week--label {
  min-height: 0;
  padding: 16px 0 6px;
}

.cal__mname {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
}

.cal__day {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 5px 2px 6px;
  border-top: 1px solid var(--line);
}

.cal__day.is-blank {
  border-top-color: transparent;
}

.cal__num {
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1;
}

/* Today is the one live thing on the page. */
.cal__day .cal__num.is-today {
  background: var(--live);
  color: var(--bg);
  font-weight: 600;
}

/* An event, in its day: Harbour Steel because it opens. */
.cal__event {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  min-width: 0;
  padding: 3px 4px 4px;
  border: none;
  border-radius: 5px;
  background: rgba(111, 168, 199, 0.16);
  color: #8dc0dc;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease);
}

.cal__event-title,
.cal__event-what {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 10.5px;
  line-height: 1.25;
}

.cal__event-title {
  font-weight: 600;
}

.cal__event-time {
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.2;
  color: var(--dimmer);
}

/* What has already happened stays legible, one step back. */
.cal__event.is-past {
  background: rgba(125, 135, 148, 0.12);
  color: var(--dimmer);
}

.cal__event.is-past .cal__event-time {
  color: var(--dim);
}

.cal__event:focus-visible {
  outline-offset: 1px;
}

.cal__todaybtn {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--cool);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .cal__event:hover {
    background: rgba(111, 168, 199, 0.24);
  }

  .cal__event.is-past:hover {
    background: rgba(125, 135, 148, 0.18);
  }

  .cal__todaybtn:hover {
    background: var(--panel-hi);
    border-color: var(--line-hi);
  }
}

.cal__event:active {
  background: rgba(111, 168, 199, 0.3);
}

.cal__event.is-past:active {
  background: rgba(125, 135, 148, 0.24);
}

.cal__todaybtn:active {
  background: var(--panel2);
}

/* ---- one event ---- */

.cal__detail {
  padding: 22px 20px 28px;
}

.cal__detail-title {
  font-size: 21px;
  font-weight: 600;
  line-height: 1.25;
}

.cal__detail-date {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 12.5px;
}

.cal__detail-time {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--dim);
}

.cal__notes {
  margin-top: 22px;
  padding: 12px 14px 14px;
  border-radius: 12px;
  background: var(--panel);
}

.cal__notes-label {
  font-size: 12px;
  color: var(--dim);
}

.cal__notes-body {
  margin-top: 5px;
  font-size: 14.5px;
  line-height: 1.5;
}

/* ============================================================
   SWIPE UP TO OPEN

   The foot of the lock screen: a line of text over the home
   indicator, both in the wallpaper's own light (Paper Grey with
   a close dark shadow), so they read on her photo without a
   panel behind them. The bar sits exactly where the home
   indicator sits once the phone is open, and the whole strip is
   the grab area. See swipeToOpen() in ui/lock.js.
   ============================================================ */

.lock__lift {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.swipe {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  width: 100%;
  height: 78px;
  /* The open phone's indicator is centred in a 38px bar with 2px under it,
     so its bottom edge is 18px up. */
  padding: 0 0 18px;
  background: none;
  border: none;
  color: var(--text);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.swipe:active {
  cursor: grabbing;
}

.swipe__label {
  font-size: 13px;
  letter-spacing: 0.04em;
  opacity: 0.72;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  transition: opacity var(--t-fast) var(--ease);
}

.swipe__bar {
  width: 118px;
  height: 4px;
  border-radius: 4px;
  background: var(--text);
  opacity: 0.6;
  transition: opacity var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .swipe:hover .swipe__label {
    opacity: 0.95;
  }

  .swipe:hover .swipe__bar {
    opacity: 0.85;
  }
}

/* The same lit bar as the open phone's home indicator. */
.swipe:focus-visible {
  outline: none;
}

.swipe:focus-visible .swipe__bar {
  background: var(--cool);
  opacity: 1;
}

/* A press that never became a drag: the screen lifts a little and settles.
   The label brightens with it, which is the half that survives reduced
   motion. */
.lock__lift--nudge {
  animation: lock-nudge 520ms var(--ease);
}

.lock__lift--nudge .swipe__label {
  animation: swipe-cue 900ms var(--ease);
}

@keyframes lock-nudge {
  35% {
    transform: translateY(-16px);
  }
  100% {
    transform: none;
  }
}

@keyframes swipe-cue {
  30% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lock__lift--nudge {
    animation: none;
  }
}

/* ============================================================
   THE HANDSET IS OUT

   The screen is off, so there is nothing on it — no status bar,
   no home indicator, no clock. The only thing that still answers
   is the port on the bottom edge.
   ============================================================ */

.frame:has(.dead) {
  background: #000;
}

.frame:has(.dead) .statusbar,
.frame:has(.dead) .bottombar {
  display: none;
}

.dead {
  flex: 1;
  min-height: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dead__glyph {
  animation: dead-in 700ms var(--ease) both;
}

/* The second attempt. Sand, not a dead cable: the contact takes, drops, takes
   again and gives up, and the glyph does exactly that. Hard steps rather than
   a fade — a bad contact is a switch, not a dimmer. Declared above the is-out
   rule so the fade still wins when both classes are on the element. */
.dead__glyph.is-flicker {
  animation: dead-flicker 1500ms steps(1, end) both;
}

.dead__glyph.is-out {
  animation: dead-out 700ms var(--ease) both;
}

@keyframes dead-in {
  from {
    opacity: 0;
  }
}

@keyframes dead-out {
  to {
    opacity: 0;
  }
}

@keyframes dead-flicker {
  0% {
    opacity: 0;
  }
  6% {
    opacity: 1;
  }
  22% {
    opacity: 0;
  }
  31% {
    opacity: 1;
  }
  54% {
    opacity: 0;
  }
  61% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}

/* The empty-battery glyph a dead phone shows when you plug it in. */
.dead__batt {
  position: relative;
  display: block;
  width: 46px;
  height: 86px;
  border: 2px solid #3a3a3a;
  border-radius: 7px;
  padding: 3px;
}

.dead__batt-fill {
  display: block;
  height: 5%;
  background: #d9534a;
  border-radius: 2px;
}

.dead__batt-nub {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 5px;
  border-radius: 2px 2px 0 0;
  background: #3a3a3a;
}

/* ---- it took ----

   Cool rather than the red of the empty glyph, and never --live: orange is
   threat everywhere else in this interface and this is the opposite of that.

   The cell fills whole and breathes rather than climbing. It is a status
   light and not a gauge: a handset this flat has no level worth drawing, and
   the status bar takes over with the real number the moment it can boot. A
   fill that climbed would also spend most of its sweep leaving the bolt on
   black, where a dark bolt cannot be seen. */
.dead__glyph.is-charging .dead__batt-fill {
  height: 100%;
  background: var(--cool);
  animation: dead-pulse 2400ms var(--ease) infinite;
}

@keyframes dead-pulse {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}

/* Dark on the fill, the way a charging phone puts it there. Centred on the
   cell, which the fill covers whole, so it reads at every point of the
   pulse. */
.dead__bolt {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 15px;
  height: 26px;
  background: var(--bg);
  clip-path: var(--bolt);
}

/* ---- the port, on the bottom edge of the device ---- */

.device__port {
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 54px;
  height: 4px;
  padding: 0;
  border: none;
  border-radius: 0 0 3px 3px;
  background: var(--line);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}

.device__port::before {
  /* a hittable target around a 4px sliver */
  content: "";
  position: absolute;
  inset: -10px -16px -14px;
}

.device__port.is-live {
  background: var(--line-hi);
}

/* The wire is in. The port reads as occupied rather than as available — the
   invitation is over, and there is nothing left to poke. Two class selectors
   beat the hover rule below, which is the point. */
.device__port.is-plugged {
  background: var(--cool);
  cursor: default;
}

@media (hover: hover) and (pointer: fine) {
  .device__port:hover {
    background: var(--line-hi);
  }

  .device__port.is-live:hover {
    background: var(--dim);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dead__glyph,
  .dead__glyph.is-out,
  .dead__glyph.is-flicker,
  .dead__glyph.is-charging .dead__batt-fill {
    animation: none;
  }

  /* The flicker *was* the second attempt. With the motion gone it needs to
     be something, or a bad contact looks exactly like the first attempt —
     so it is said in opacity, which is a state and not a movement. Before
     the is-out rule, so the fade still wins when both are on. */
  .dead__glyph.is-flicker {
    opacity: 0.45;
  }

  .dead__glyph.is-out {
    opacity: 0;
  }

  /* The pulse was the only thing saying it is working, so with the motion
     gone the fill settles at a level instead of at either end of one. */
  .dead__glyph.is-charging .dead__batt-fill {
    opacity: 0.75;
  }
}

/* ---- roads and chart furniture ---- */

.geo__track path {
  fill: none;
  stroke: #3a4753;
  stroke-width: 0.9;
  stroke-linecap: round;
  stroke-dasharray: 7 4;
  opacity: 0;
  transition: opacity var(--t-med) var(--ease);
}

.map.is-close .geo__track path {
  opacity: 1;
}

.mark {
  color: #6c8296;
  opacity: 0;
  transition: opacity var(--t-med) var(--ease);
  pointer-events: none;
}

.map.is-close .mark {
  opacity: 1;
  /* Only tappable once it can be seen. */
  pointer-events: auto;
  cursor: pointer;
}

.mark__hit {
  fill: transparent;
}

.mark.is-selected {
  color: var(--text);
}

.mark.is-selected .mark__label {
  fill: var(--text);
}

.mark.is-off {
  display: none;
}

/* A light is the one piece of furniture that earns a warmer colour: it is the
   thing on this coast that is meant to be seen from a long way off. */
.mark--light {
  color: #9b8b6a;
}

.mark__icon {
  overflow: visible;
}

.mark__label {
  fill: var(--dimmer);
  font-family: var(--mono);
  font-size: 8.5px;
  text-anchor: middle;
  paint-order: stroke;
  stroke: #060a0e;
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.mark.label-clash:not(.is-selected) .mark__label {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .geo__track path,
  .mark {
    transition: none;
  }
}

/* ---- weather on the map ----

   Weather gets no wash of its own: a grey sheet over a map reads as a
   loading state, not as weather. What weather does here is take distance
   away — the shallows and then the grid go, which is what a view actually
   loses. */

.map[data-fog="fog"] .geo__shallow path,
.map[data-fog="thick"] .geo__shallow path {
  opacity: 0.45;
}

.map[data-fog="thick"] .grat line {
  opacity: 0.28;
}

.map[data-fog="thick"] .mark {
  opacity: 0.55;
}

.statusbar__weather {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--dim);
  letter-spacing: 0.04em;
}

.statusbar__weather.is-thick {
  color: var(--live);
}

/* ---- the drop's upload box ---- */

.drop__box {
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px dashed var(--line-hi);
  border-radius: 12px;
}

.drop__box.is-done {
  border-style: solid;
  border-color: var(--line);
}

.drop__label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--dimmer);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.drop__box p {
  margin: 0 0 12px;
  font-size: 13px;
}

.drop__file {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 11px 13px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease);
}

.drop__file-name {
  font-size: 13.5px;
}

.drop__file-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dimmer);
  white-space: nowrap;
}

/* ---- the voicemail challenge ---- */

.call__challenge {
  padding: 16px 0 8px;
}

.call__pin-hint {
  font-size: 12.5px;
  color: var(--dim);
  margin-bottom: 10px;
}

.call__pin {
  font-family: var(--mono);
  font-size: 18px;
  text-align: center;
  letter-spacing: 0.34em;
  margin-bottom: 8px;
}

.call__pin-err {
  color: var(--live);
  font-size: 12px;
  min-height: 16px;
  margin-bottom: 8px;
}

/* ---- notes the player writes ---- */

.note__new {
  padding: 4px 20px 12px;
  flex-shrink: 0;
}

/* The plus is drawn, so it centres on the label; the full-width ＋ it
   replaces sat on the baseline and came out of whichever font had it. */
.note__new .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.note__new .icon {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
}

.note__row-title {
  font-size: 14px;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
}

.note__mine {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--dimmer);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 4px;
}

.note__editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note__title-field {
  font-size: 16px;
  font-weight: 600;
}

.note__body-field {
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.7;
  resize: none;
  min-height: 220px;
}

.note__delete {
  margin-top: auto;
}

@media (hover: hover) and (pointer: fine) {
  .drop__file:hover {
    background: var(--panel-hi);
    border-color: var(--cool);
  }
}

.call__ask {
  font-family: var(--sans);
  font-size: 15px;
  text-align: center;
  margin-bottom: 8px;
}

/* ============================================================
   THE UPDATE

   Act two's install screen, and the two surfaces it leaves
   behind: a notice an app puts at the top of itself when a
   permission it needs has been taken away, and the switch in
   Settings that gives it back.

   The notice is cool, not orange. Orange is reserved for
   live/threat and an app saying what it cannot currently do is
   neither — it is the handset being unhelpful, which is the
   register everything else on it is already in.
   ============================================================ */

.update {
  position: absolute;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 44px;
  text-align: center;
}

/* A ring, drawn rather than typed, so the screen carries a mark without
   borrowing anybody's logo. */
.update__mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--line-hi);
  border-top-color: var(--cool);
  margin-bottom: 6px;
}

.update__title {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text);
  letter-spacing: 0.01em;
}

.update__bar {
  width: 100%;
  max-width: 210px;
  height: 3px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}

.update__fill {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--cool);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 200ms linear;
}

.update__pct {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--dim);
}

.update__note {
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--dimmer);
  margin-top: 10px;
}

/* ---- an app saying what it cannot do ----
   The dot carries the colour; the card is hairline all round. A thicker
   cool edge down one side said the same thing twice, louder. The dot sits
   on the first line, so a notice that wraps still reads from its mark. */

.notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 10px 16px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
}

.notice__dot {
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--cool);
}

/* ---- an app the update left behind ----
   The app's own name in its header and its own mark in the middle, so it
   reads as Messages refusing to start rather than as somewhere else. */

.stale {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 34px 40px;
  text-align: center;
}

.stale__icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 15px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--dim);
  margin-bottom: 6px;
}

.stale__icon .icon {
  width: 30px;
  height: 30px;
}

.stale__title {
  font-size: 15px;
  font-weight: 600;
}

.stale__note {
  font-size: 13px;
  line-height: 1.6;
  color: var(--dim);
  margin: 0 0 10px;
}

.stale .btn {
  max-width: 240px;
}

/* ---- the Store ---- */

.store {
  padding: 4px 20px 32px;
}

.store__out {
  font-size: 13px;
  line-height: 1.6;
  color: var(--dim);
  margin: 6px 0 4px;
}

.store__step {
  font-size: 17px;
  font-weight: 600;
  margin-top: 14px;
}

.store__acct {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--dimmer);
  margin: 4px 0 8px;
}

.store .set__label {
  padding: 0;
  margin: 22px 0 6px;
}

.store__all {
  margin: 10px 0 4px;
}

.store__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.store__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--dim);
}

.store__icon .icon {
  width: 22px;
  height: 22px;
}

.store__meta {
  flex: 1;
  min-width: 0;
}

.store__name {
  font-size: 14px;
}

.store__ver {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dimmer);
  margin-top: 2px;
}

.store__note {
  font-size: 12px;
  line-height: 1.5;
  color: var(--dim);
  margin-top: 4px;
}

.store__act {
  flex: none;
  display: flex;
  align-items: center;
}

.store__act .store__bar {
  display: none;
  width: 58px;
}

.store__act.is-loading .btn {
  display: none;
}

.store__act.is-loading .store__bar {
  display: block;
}

/* ---- one privacy switch ---- */

.set__toggle {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 3px 11px;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.set__toggle.is-on {
  color: var(--cool);
  border-color: var(--cool);
  background: var(--cool-wash);
}

.set__toggle:active {
  background: var(--panel-hi);
}

@media (hover: hover) and (pointer: fine) {
  .set__toggle:hover {
    background: var(--panel-hi);
    border-color: var(--line-hi);
    color: var(--text);
  }
}

@media (prefers-reduced-motion: reduce) {
  .update__fill {
    transition: none;
  }
}

/* ============================================================
   THE HANDSET RINGING

   A takeover, over the lock screen and over whatever app is
   open — including, once, over a call. It borrows the call
   screen's own classes for the answered half, because that is
   what it is; only the ringing half needs anything of its own.
   ============================================================ */

.incoming {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0;
}

.incoming__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 64px 24px 0;
  text-align: center;
}

.incoming__label {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--dim);
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

/* It pulses rather than glows: orange is for live and threat, and a delivery
   firm is neither. */
.incoming__head .call__who {
  animation: incoming-breathe 2.4s var(--ease) infinite;
}

@keyframes incoming-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.62; }
}

.incoming__sub {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--dimmer);
}

.incoming__actions {
  display: flex;
  gap: 10px;
  padding: 0 20px 26px;
}

.incoming__actions .btn {
  flex: 1;
}

@media (prefers-reduced-motion: reduce) {
  .incoming__head .call__who {
    animation: none;
  }
}

/* ============================================================
   GLIMT

   Her photo app. Photographs are the only full-colour thing on
   the handset, so the chrome around them stays as quiet as the
   rest of it: no accent colour, no heart, nothing that glows.
   ============================================================ */

.glimt {
  position: relative;
}

.glimt__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.glimt__wordmark {
  font-family: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  font-style: italic;
  font-size: 34px;
  letter-spacing: 0.01em;
  color: var(--text);
}

.glimt__wordmark--bar {
  font-size: 21px;
}

.glimt__bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 9px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.glimt__tabs {
  display: flex;
  flex-shrink: 0;
  background: var(--chrome);
  border-top: 1px solid var(--line);
}

.glimt__tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px;
  background: none;
  border: none;
  color: var(--dim);
  font-size: 12.5px;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease);
}

.glimt__tab.is-on {
  color: var(--text);
}

/* ---- sign in ---- */

.glimt__login {
  padding: 40px 26px 26px;
}

.glimt__out {
  margin: 10px 0 18px;
  font-size: 13px;
  color: var(--dim);
}

.glimt__err {
  min-height: 18px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--live);
}

.glimt__info {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--dim);
}

.glimt__forgot {
  display: block;
  margin: 16px auto 0;
  padding: 4px;
  background: none;
  border: none;
  color: var(--cool);
  font-size: 13px;
  cursor: pointer;
}

/* ---- avatars ---- */

.gav {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--dim);
  font-size: 11px;
  font-weight: 600;
}

.gav img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gav--xs {
  width: 18px;
  height: 18px;
  font-size: 8px;
}

.gav--l {
  width: 74px;
  height: 74px;
  font-size: 22px;
}

/* ---- photographs ---- */

.gphoto {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: linear-gradient(160deg, #1d2631, #11161c);
}

/* The <picture> around each image is only a chooser between AVIF and JPEG;
   `display: contents` keeps it out of the layout, so the <img> still sizes
   against the photo box and the avatar circle. */
.gphoto picture,
.gav picture {
  display: contents;
}

.gphoto img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* Until the photograph exists: what it is of, so the game can be played and
   the clues can be read before a single image has been made. */
.gphoto__ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  padding: 16px;
  text-align: left;
}

.gphoto__id {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--dimmer);
}

.gphoto__alt {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--dim);
}

.gphoto--thumb .gphoto__ph {
  padding: 8px;
}

.gphoto--thumb .gphoto__alt {
  display: none;
}

.gphoto--view {
  width: 100%;
  transition: transform var(--t-med) var(--ease);
}

/* ---- a post ---- */

.gpost {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.gpost__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}

.gpost__av {
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
}

.gpost__id {
  min-width: 0;
}

.gpost__who {
  padding: 0;
  background: none;
  border: none;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.gpost__who--inline {
  font-size: inherit;
}

.gpost__where {
  font-size: 11.5px;
  color: var(--dim);
}

.gpost__when {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dimmer);
}

.gpost__photo {
  display: block;
  width: 100%;
  padding: 0;
  background: none;
  border: none;
  cursor: zoom-in;
}

.gpost__likes {
  padding: 10px 14px 0;
  font-size: 13px;
  font-weight: 600;
}

.gpost__cap {
  margin: 4px 14px 0;
  font-size: 13.5px;
  line-height: 1.5;
}

.gpost__more {
  padding: 6px 14px 0;
  background: none;
  border: none;
  color: var(--dim);
  font-size: 13px;
  cursor: pointer;
}

.gpost__archived {
  padding: 8px 14px 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dimmer);
}

.glimt__end {
  padding: 24px;
  text-align: center;
}

/* ---- a profile ---- */

.gprof {
  padding: 16px 18px 14px;
}

.gprof__top {
  display: flex;
  align-items: center;
  gap: 18px;
}

.gprof__stats {
  flex: 1;
  display: flex;
  justify-content: space-around;
}

.gprof__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.gprof__stat b {
  font-size: 15px;
}

.gprof__stat span {
  font-size: 11.5px;
  color: var(--dim);
}

.gprof__handle {
  margin-top: 12px;
  font-size: 15px;
  font-weight: 600;
}

.gprof__name {
  margin-top: 2px;
  font-size: 13px;
}

.gprof__bio {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--dim);
}

.gprof__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ggrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

.ggrid__cell {
  display: block;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.glimt__empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--dim);
  font-size: 13.5px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ---- comments ---- */

.glimt__comments {
  padding: 6px 0 16px;
}

.gcomment {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
}

.gcomment__body {
  font-size: 13.5px;
  line-height: 1.5;
}

.gcomment__when {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--dimmer);
}

.gcomment__rule {
  margin: 4px 16px;
  border-top: 1px solid var(--line);
}

/* ---- Direct ---- */

.glimt__dm {
  position: relative;
  display: flex;
  padding: 4px;
  margin-right: -4px;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
}

.glimt__dm .icon {
  width: 22px;
  height: 22px;
}

.glimt__dot {
  position: absolute;
  top: 3px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 2px var(--bg);
}

.glimt__dot[hidden] {
  display: none;
}

.glimt__dot--row {
  position: static;
  flex-shrink: 0;
  box-shadow: none;
}

.ginbox__row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.ginbox__row .gav {
  width: 44px;
  height: 44px;
}

.ginbox__text {
  flex: 1;
  min-width: 0;
}

.ginbox__who {
  font-size: 14px;
}

.ginbox__prev {
  margin-top: 2px;
  overflow: hidden;
  font-size: 13px;
  color: var(--dim);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ginbox__row.is-unread .ginbox__who,
.ginbox__row.is-unread .ginbox__prev {
  color: var(--text);
  font-weight: 600;
}

.gdm__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 16px 20px;
  text-align: center;
}

.gdm__card .btn--tiny {
  margin-top: 4px;
}

.gdm__seen {
  margin: 2px 20px 10px;
  text-align: right;
  font-size: 11px;
  color: var(--dimmer);
}

/* ---- Login activity ---- */

.glogin__head {
  padding: 16px 18px 6px;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dimmer);
}

.glogin {
  padding: 10px 18px 11px;
  border-top: 1px solid var(--line);
}

.glogin__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.glogin__what {
  font-size: 14px;
}

.glogin__when {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dimmer);
}

.glogin__where {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
}

/* ---- the viewer ---- */

.gview {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  background: rgba(5, 7, 10, 0.96);
  animation: sheet-dim var(--t-med) var(--ease) both;
}

/* The photograph comes up out of the feed rather than appearing over it,
   and settles back on the way out. The zoom transform is on the picture,
   not the stage, so the two never fight. */
.gview .gview__stage {
  animation: gview-up var(--t-slow) var(--ease) both;
}

.gview.is-leaving {
  animation: overlay-out 180ms ease-in both;
  pointer-events: none;
}

.gview.is-leaving .gview__stage {
  animation: gview-down 180ms ease-in both;
}

@keyframes gview-up {
  from {
    transform: scale(0.94);
  }
}

@keyframes gview-down {
  to {
    transform: scale(0.96);
  }
}

.gview__stage {
  width: 100%;
  overflow: hidden;
  touch-action: none;
  cursor: zoom-in;
}

.gview.is-zoomed .gview__stage {
  cursor: grab;
}

.gview__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.gview__close .icon {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

@media (prefers-reduced-motion: reduce) {
  .gphoto--view,
  .glimt__tab {
    transition: none;
  }

  .gview,
  .gview .gview__stage {
    animation: none;
  }
}

/* ---- the cipher page, in the browser ---- */

.page__modes {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.page__modes .btn.is-on {
  border-color: var(--cool);
  color: var(--text);
}

/* The decoder's tabs sit under its title, and the line that explains the
   tab goes under them. */
.page__modes + p {
  margin-top: 14px;
}

.page pre.page__out {
  min-height: 52px;
  margin-top: 0;
}

/* ---- Dagens lyd, in the browser ----

   A spectrogram is drawn in the page's own inks: the marks in the cool
   blue, anything the site labels on top of it in the live orange. */

.lyd__me {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--dimmer);
  margin-bottom: 8px;
}

.spec {
  display: block;
  width: 100%;
  height: auto;
  margin: 6px 0 14px;
}

.spec__bg {
  fill: var(--panel);
}

.spec__grid {
  stroke: var(--line);
  stroke-width: 0.5;
}

.spec__axis {
  fill: var(--dimmer);
  font-family: var(--mono);
  font-size: 8.5px;
}

.spec__ink {
  stroke: var(--cool);
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.spec__fill {
  fill: var(--cool);
}

.spec__mark {
  stroke: var(--live);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.spec__mark-label {
  fill: var(--live);
  font-family: var(--mono);
  font-size: 8.5px;
}

.page pre.lyd__hear {
  font-size: 12.5px;
  line-height: 1.65;
}

.lyd__clues {
  margin: 16px 0 4px;
}

.lyd__clue {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text);
  border-left: 2px solid var(--line-hi);
  padding-left: 12px;
  margin: 0 0 12px;
}

.lyd__clue-n {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--dimmer);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.lyd__guesses {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
}

.lyd__guess {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dimmer);
  text-decoration: line-through;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px 8px;
  overflow-wrap: anywhere;
}

.lyd__row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.lyd__row .btn.lyd__go {
  flex: 1;
}

.lyd__row .btn--tiny {
  flex-shrink: 0;
}

.lyd__result {
  margin-top: 22px;
  padding: 14px 16px 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.lyd__answer {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 10px;
}

.lyd__result p {
  font-size: 13.5px;
}

/* ---- the touch-tone table ---- */

.page table.dtmf {
  table-layout: fixed;
  margin-top: 6px;
}

.dtmf th {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  color: var(--dimmer);
  padding: 4px 0;
  text-align: center;
}

.dtmf td {
  padding: 3px;
  text-align: center;
}

.dtmf__key {
  width: 100%;
  min-height: 44px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-size: 17px;
  cursor: pointer;
}

.dtmf__key.is-rare {
  color: var(--live);
  border-style: dashed;
}

.dtmf__key:active {
  background: var(--panel-hi);
}

/* ---- the Morse table ----

   Letters, digits, punctuation, each a block of its own. The code is set in
   the mono face so a dot and a dash keep their widths. */

.morse {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 4px 10px;
  margin: 18px 0 0;
}

.morse__cell {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.morse dt {
  width: 14px;
  color: var(--text);
  font-size: 13.5px;
}

.morse dd {
  margin: 0;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
}

/* ============================ MAIL ============================ */

.mail {
  padding: 16px 22px 24px;
}

.mail__subject {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.mail__meta {
  margin-top: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.6;
  color: var(--dim);
}

.mail__meta b {
  color: var(--text);
  font-weight: 600;
}

.mail__body {
  margin-top: 14px;
  white-space: pre-line;
  font-size: 14px;
  line-height: 1.65;
}

.mail__open {
  margin-top: 22px;
}

/* The one attachment in her mail. A file, so it reads like the rows in
   Recordings: a name, then its length in the same mono. */
.mail__attach {
  margin-top: 18px;
  padding: 12px 14px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.mail__fname {
  font-family: var(--mono);
  font-size: 13px;
}

.mail__fmeta {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
}

.mail__attach .btn {
  margin-top: 12px;
}

/* ============================================================
   iOS FIELDS

   Safari on iOS zooms the page onto any field set under 16px the
   moment it takes focus, and leaves it zoomed when focus goes —
   the handset ends up half off the screen. Every field the player
   types into is held at 16px there and nowhere else: the rest of
   the world keeps the handset's own type sizes. `-webkit-touch-
   callout` is the test because only iOS WebKit supports it.

   The dial and the code entry are left alone — both are already
   over the line, and the selector is two classes so it beats
   `.call__ask` without depending on where it sits in this file.
   ============================================================ */

@supports (-webkit-touch-callout: none) {
  .field:not(.dial__num):not(.call__pin),
  .urlbar__input {
    font-size: 16px;
  }
}

/* ============================================================
   ABOUT ME (ui/about.js)

   The developer's card, styled after stancevicbranko.com and
   not after the game: its own near-black, its gold, its Geist,
   its round photo in a gold ring and its lifting link tiles. The
   tokens are scoped to the dialog so none of them leak into the
   handset. Geist Sans is by Vercel, under the SIL Open Font
   License 1.1.
   ============================================================ */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/about/geist-sans.woff2") format("woff2");
}

.about {
  --a-card: #141414;
  --a-accent: #f0b429;
  --a-accent-dim: rgba(240, 180, 41, 0.15);
  --a-text: #e5e5e5;
  --a-muted: #888;
  --a-border: rgba(255, 255, 255, 0.08);
  --a-ease: cubic-bezier(0.16, 1, 0.3, 1);

  width: min(380px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: none;
  background: none;
  color: var(--a-text);
  overflow: visible;
  /* It sits inside the cold open in the DOM; its 1.65 is for the story. */
  line-height: 1.5;
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.about[open] {
  animation: about-in 350ms var(--a-ease) both;
}

.about::backdrop {
  background: rgba(5, 7, 10, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: about-fade 350ms var(--a-ease) both;
}

.about.is-leaving {
  animation: about-out 200ms var(--a-ease) both;
}

.about.is-leaving::backdrop {
  animation: about-fade 200ms var(--a-ease) reverse both;
}

@keyframes about-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

@keyframes about-out {
  to {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
}

@keyframes about-fade {
  from {
    opacity: 0;
  }
}

.about__card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 34px 24px 24px;
  border: 1px solid var(--a-border);
  border-radius: 20px;
  background: var(--a-card);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.about__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  color: var(--a-muted);
  cursor: pointer;
  transition: color 150ms var(--a-ease), border-color 150ms var(--a-ease);
}

.about__close .icon {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

/* The site's status line: small capitals in gold between two short rules. */
.about__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--a-accent);
}

.about__eyebrow::before,
.about__eyebrow::after {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--a-accent);
  opacity: 0.5;
}

.about__photo {
  width: 120px;
  height: 120px;
  margin: 22px 0 20px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--a-border);
  box-shadow: 0 0 0 4px var(--a-accent-dim);
  background: #0d0d0d;
}

.about__name {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.25;
}

.about__initial {
  color: var(--a-accent);
}

.about__title {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--a-muted);
  text-wrap: balance;
}

.about__where {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--a-muted);
}

.about__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--a-accent);
  animation: about-pulse 2.5s ease-in-out infinite;
}

@keyframes about-pulse {
  50% {
    opacity: 0.45;
    transform: scale(0.8);
  }
}

/* Room above the tiles for one to lift into. */
.about__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
}

.about__link-wrap {
  position: relative;
  width: 52px;
  height: 52px;
}

.about__link {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--a-border);
  border-radius: 12px;
  color: var(--a-muted);
  transition: transform 600ms var(--a-ease), border-color 250ms var(--a-ease),
    color 250ms var(--a-ease);
}

.about__link svg {
  width: 22px;
  height: 22px;
}

.about__link-label {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--a-muted);
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms var(--a-ease);
}

.about__site {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 26px;
  padding: 6px 4px;
  font-size: 13px;
  color: var(--a-muted);
  text-decoration: none;
  transition: color 150ms var(--a-ease);
}

.about__site svg {
  width: 15px;
  height: 15px;
}

.about a:focus-visible,
.about__close:focus-visible {
  outline: 2px solid var(--a-accent);
  outline-offset: 2px;
}

.about__link:focus-visible {
  border-color: var(--a-accent);
  color: var(--a-accent);
}

@media (hover: hover) and (pointer: fine) {
  .about__link-wrap:hover .about__link {
    transform: translateY(-15px);
    border-color: var(--a-accent);
    color: var(--a-accent);
  }

  .about__link-wrap:hover .about__link-label {
    opacity: 1;
    transition-delay: 100ms;
  }

  .about__site:hover,
  .about__close:hover {
    color: var(--a-accent);
  }

  .about__close:hover {
    border-color: var(--a-border);
  }
}

.about__link:active {
  border-color: var(--a-accent);
  color: var(--a-accent);
}

/* The smallest phones: the name and the five tiles each keep to one line. */
@media (max-width: 359px) {
  .about__card {
    padding-inline: 16px;
  }

  .about__name {
    font-size: 26px;
  }

  .about__links {
    gap: 6px;
  }

  .about__link-wrap {
    width: 44px;
    height: 44px;
  }

  .about__link svg {
    width: 20px;
    height: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .about[open],
  .about::backdrop,
  .about.is-leaving,
  .about.is-leaving::backdrop,
  .about__dot {
    animation: none;
  }

  .about__link {
    transition: none;
  }
}

/* ============================================================
   SUPPORT THE DEV (ui/support.js)

   Ko-fi's donation panel in a sheet of the game's own: a Bezel
   card, a hairline under its head and over its foot, Fog for
   everything that is not the panel. The panel is Ko-fi's page,
   light, and nothing here can restyle it. No Sodium Lamp:
   nothing in the sheet is live. It comes and goes the way the
   About card does, on that card's keyframes.
   ============================================================ */

.support-sheet {
  width: min(400px, calc(100vw - 32px));
  height: min(760px, calc(100dvh - 32px));
  margin: auto;
  padding: 0;
  border: none;
  background: none;
  color: var(--text);
  overflow: visible;
  font-family: var(--sans);
  line-height: 1.5;
}

.support-sheet[open] {
  animation: about-in 350ms var(--ease) both;
}

.support-sheet::backdrop {
  background: rgba(5, 7, 10, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: about-fade 350ms var(--ease) both;
}

.support-sheet.is-leaving {
  animation: about-out 200ms var(--ease) both;
}

.support-sheet.is-leaving::backdrop {
  animation: about-fade 200ms var(--ease) reverse both;
}

.support-sheet__card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--chrome);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}

.support-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 0 8px 0 18px;
  border-bottom: 1px solid var(--line);
}

.support-sheet__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.support-sheet__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  color: var(--dim);
  cursor: pointer;
  transition: color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease);
}

.support-sheet__close .icon {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

/* Blackwater with a mono "Loading Ko-fi…" until the frame has loaded, then
   the frame fades in over it. */
.support-sheet__body {
  position: relative;
  flex: 1;
  min-height: 0;
  background: var(--bg);
}

.support-sheet__wait {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--dim);
}

.support-sheet__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease);
}

.support-sheet__body.is-ready .support-sheet__frame {
  opacity: 1;
}

/* The page's address, in mono like every URL: the way out to a tab. */
.support-sheet__out {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}

.support-sheet__out svg {
  width: 13px;
  height: 13px;
}

.support-sheet__out:focus-visible {
  outline: 2px solid var(--cool);
  outline-offset: -2px;
}

@media (hover: hover) and (pointer: fine) {
  .support-sheet__close:hover {
    color: var(--text);
    border-color: var(--line);
  }

  .support-sheet__out:hover {
    color: var(--text);
  }
}

.support-sheet__close:active {
  background: var(--panel);
}

@media (prefers-reduced-motion: reduce) {
  .support-sheet[open],
  .support-sheet::backdrop,
  .support-sheet.is-leaving,
  .support-sheet.is-leaving::backdrop {
    animation: none;
  }

  .support-sheet__frame {
    transition: none;
  }
}

/* ============================================================
   YOUR RUN (ui/ledger.js)

   The ledger at the end, in Support's sheet: the same Bezel
   card and head, sized to what it lists rather than to a frame.
   A tick in Harbour Steel for everything done; what was missed
   is Fog, and an optional find not yet made is ??? with a line
   in Dim saying where to look. Times in mono, like every number
   the game prints.
   ============================================================ */

.ledger {
  height: auto;
  max-height: calc(100dvh - 32px);
}

.ledger .support-sheet__card {
  height: auto;
  max-height: calc(100dvh - 32px);
}

.ledger__body {
  overflow-y: auto;
  padding: 16px 18px 22px;
}

.ledger__total {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}

.ledger__sep {
  color: var(--dim);
}

.ledger__best {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--dim);
}

.ledger__part {
  margin: 22px 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dimmer);
}

.ledger__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ledger__row {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--text);
}

.ledger__row:last-child {
  border-bottom: none;
}

.ledger__mark {
  display: inline-flex;
  justify-content: center;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12px;
}

.ledger__mark.is-done {
  color: var(--cool);
}

.ledger__mark .icon {
  width: 15px;
  height: 15px;
  stroke-width: 2;
  transform: translateY(2px);
}

.ledger__name {
  min-width: 0;
}

.ledger__where {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--dim);
}

.ledger__row.is-hidden .ledger__name,
.ledger__row.is-missed .ledger__name {
  color: var(--dim);
}

.ledger__time {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
}

/* The pill, brighter until it has been opened once: it is news. */
.ledger-btn.is-new {
  color: var(--cool);
  border-color: var(--cool);
}
