/* Tether — dreamy pink.
 *
 * One theme with two moods. Not light/dark: the mood follows the connection.
 * When the other laptop is asleep the sky drifts into night and the queued
 * messages grow little moons. That state is the one Muni will see most often,
 * so it is deliberately the prettiest screen in the app rather than an error.
 */

/* ---------------------------------------------------------------- fonts -- */
/* Self-hosted so the app renders identically with no network at all.
 * Quicksand, SIL Open Font License 1.1. Regenerate with tools/fetch_fonts.py.
 *
 * Both subsets are declared. latin-ext carries ğ, ş and İ — without it those
 * letters would drop to a fallback typeface in the middle of a Turkish word. */
@font-face {
  font-family: 'Quicksand';
  src: url('/fonts/quicksand-500-latin.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Quicksand';
  src: url('/fonts/quicksand-500-latin-ext.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Quicksand';
  src: url('/fonts/quicksand-600-latin.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Quicksand';
  src: url('/fonts/quicksand-600-latin-ext.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Quicksand';
  src: url('/fonts/quicksand-700-latin.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Quicksand';
  src: url('/fonts/quicksand-700-latin-ext.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --------------------------------------------------------------- tokens -- */
/* Contrast note: pale pink with white text is the classic accessibility trap —
 * it photographs beautifully and is genuinely hard to read. The original
 * gradient measured 2.14:1 against white, where WCAG AA asks 4.5:1 for text
 * this size. Every pair below is now measured, not guessed: run
 * `python3 tools/check_contrast.py` after touching any of these. Hue and
 * saturation are held steady and only lightness moved, so it is the same rose
 * — just deep enough to actually read outdoors. */
:root {
  --bg: #fff5f8;
  --ink: #5a3e4c;
  --ink-soft: #7e5a6a;
  --ink-faint: #8a6575;

  --mine-a: #be4a73;
  --mine-b: #ad3c63;
  --mine-ink: #fff;
  --theirs: rgba(255, 255, 255, 0.72);
  --theirs-ink: #5a3e4c;

  /* --accent stays bright: it is only ever decoration (focus rings, sparkles,
   * the send-button glow). --accent-ink is the readable version, for the rare
   * places an accent colour carries actual words. */
  --accent: #ff5c93;
  --accent-ink: #be3465;
  --glass: rgba(255, 255, 255, 0.6);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --line: rgba(255, 143, 177, 0.2);
  --shadow: 0 8px 30px rgba(255, 111, 160, 0.16);
  --shadow-soft: 0 2px 12px rgba(214, 120, 155, 0.13);

  --blob-1: #ffd1e3;
  --blob-2: #ffc2d4;
  /* Kept close to pink on purpose — a truer lilac and a yellower cream mix
   * into something grey where the two blobs overlap. */
  --blob-3: #f0d7fb;
  --blob-4: #ffdfd0;
  --star: transparent;

  --radius: 22px;
  --spring: cubic-bezier(0.22, 1, 0.36, 1);
  --kb: 0px; /* keyboard height, set from visualViewport */
}

[data-mood='night'] {
  --bg: #1b1220;
  --ink: #f0dce6;
  --ink-soft: #a9889b;
  --ink-faint: #947688;

  --mine-a: #b54a70;
  --mine-b: #a8446b;
  --mine-ink: #fff4f8;
  --theirs: rgba(255, 255, 255, 0.075);
  --theirs-ink: #edd9e4;

  --accent: #ff7fac;
  --accent-ink: #ff9ec1;
  --glass: rgba(43, 27, 48, 0.55);
  --glass-strong: rgba(43, 27, 48, 0.86);
  --line: rgba(255, 143, 177, 0.14);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.28);

  --blob-1: #47264a;
  --blob-2: #35204a;
  --blob-3: #2a1a3a;
  --blob-4: #4a2a3d;
  --star: rgba(255, 240, 248, 0.9);
}

/* ----------------------------------------------------------------- base -- */
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overscroll-behavior: none;
}
body {
  font-family: 'Quicksand', ui-rounded, 'SF Pro Rounded', -apple-system,
    BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 1.4s ease, color 1.4s ease;
}
button,
textarea,
input {
  font: inherit;
  color: inherit;
}
button {
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ------------------------------------------------------------------ sky -- */
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--bg);
  transition: background-color 1.4s ease;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  opacity: 0.62;
  will-change: transform;
  transition: background-color 1.4s ease, opacity 1.4s ease;
}
.blob.b1 {
  width: 62vmax;
  height: 62vmax;
  left: -22vmax;
  top: -20vmax;
  background: var(--blob-1);
  animation: drift1 42s var(--spring) infinite alternate;
}
.blob.b2 {
  width: 52vmax;
  height: 52vmax;
  right: -18vmax;
  top: 8vmax;
  background: var(--blob-2);
  animation: drift2 55s var(--spring) infinite alternate;
}
.blob.b3 {
  width: 48vmax;
  height: 48vmax;
  left: -12vmax;
  bottom: -18vmax;
  background: var(--blob-3);
  animation: drift3 61s var(--spring) infinite alternate;
}
.blob.b4 {
  width: 40vmax;
  height: 40vmax;
  right: -14vmax;
  bottom: -12vmax;
  background: var(--blob-4);
  animation: drift4 49s var(--spring) infinite alternate;
}
@keyframes drift1 {
  to {
    transform: translate3d(10vmax, 8vmax, 0) scale(1.15);
  }
}
@keyframes drift2 {
  to {
    transform: translate3d(-12vmax, 14vmax, 0) scale(0.88);
  }
}
@keyframes drift3 {
  to {
    transform: translate3d(14vmax, -10vmax, 0) scale(1.12);
  }
}
@keyframes drift4 {
  to {
    transform: translate3d(-9vmax, -12vmax, 0) scale(0.92);
  }
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--star);
  opacity: 0;
  transition: opacity 1.4s ease;
}
[data-mood='night'] .star {
  animation: twinkle var(--dur, 4s) ease-in-out var(--delay, 0s) infinite;
}
@keyframes twinkle {
  0%,
  100% {
    opacity: 0.12;
    transform: scale(0.7);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.25);
  }
}

/* A whisper of grain stops the gradients looking like plastic. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------- layout -- */
.app {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

/* --------------------------------------------------------------- topbar -- */
.topbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--line);
  transition: background-color 1.4s ease;
}
.mark {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--mine-a), var(--mine-b));
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s var(--spring);
}
.mark:active {
  transform: scale(0.9);
}
.mark svg {
  width: 21px;
  height: 21px;
}
.who {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}

/* Only exists on an iPhone that hasn't added Tether to its Home Screen yet.
 * Until that happens notifications are impossible and Safari may evict the
 * history, so there has to be a way back to the instructions that does not
 * depend on catching a banner before it is dismissed. It removes itself for
 * good once installed. */
.pin {
  flex: none;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(150deg, var(--mine-a), var(--mine-b));
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s var(--spring);
}
.pin[hidden] {
  display: none;
}
.pin:active {
  transform: scale(0.93);
}
.pin svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.who .name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.01em;
}
.who .sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.who .sub .dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-faint);
  transition: background-color 0.5s ease, box-shadow 0.5s ease;
}
.who .sub.is-here .dot {
  background: #4ad395;
  box-shadow: 0 0 0 3px rgba(74, 211, 149, 0.22);
}
.sep {
  opacity: 0.45;
}

/* --------------------------------------------------------------- thread -- */
.thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding: 14px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.daymark {
  align-self: center;
  margin: 14px 0 10px;
  padding: 4px 13px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.row {
  display: flex;
  max-width: 100%;
  animation: rise 0.42s var(--spring) both;
}
.row.mine {
  justify-content: flex-end;
}
.row.grouped {
  margin-top: 0;
}
.row:not(.grouped) {
  margin-top: 10px;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
}

/* The column holding one bubble and its timestamp. The width cap lives here
 * rather than on the bubble so the bubble can shrink-to-fit its own text. */
.stack {
  display: flex;
  flex-direction: column;
  max-width: 78%;
  min-width: 0;
}
.mine .stack {
  align-items: flex-end;
}

.bubble {
  position: relative;
  max-width: 100%;
  padding: 9px 14px 9px;
  border-radius: var(--radius);
  font-size: 15.5px;
  line-height: 1.42;
  white-space: pre-wrap;
  user-select: text;
  -webkit-user-select: text;
  /* break-word, not anywhere: `anywhere` lets the browser treat the minimum
   * content width as a single character, which collapses short bubbles into a
   * narrow column and breaks words down the middle. `break-word` only splits
   * a word that genuinely cannot fit, which is what a long URL needs. */
  overflow-wrap: break-word;
  word-break: normal;
}
.mine .bubble {
  background: linear-gradient(150deg, var(--mine-a), var(--mine-b));
  color: var(--mine-ink);
  box-shadow: var(--shadow-soft);
}
.theirs .bubble {
  background: var(--theirs);
  color: var(--theirs-ink);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.mine.tail .bubble {
  border-bottom-right-radius: 7px;
}
.theirs.tail .bubble {
  border-bottom-left-radius: 7px;
}
.row.pending .bubble {
  opacity: 0.72;
}

.meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 3px 4px 0;
  font-size: 11px;
  color: var(--ink-faint);
  height: 0;
  opacity: 0;
  overflow: hidden;
  transition: height 0.28s var(--spring), opacity 0.28s ease;
}
.row.tail .meta,
.row.show-meta .meta,
/* A waiting message always shows its moon, even mid-group. Grouping normally
 * hides everything but the last status, which would leave her unable to see
 * which messages have actually gone. */
.row.pending .meta {
  height: 15px;
  opacity: 1;
}
.mine .meta {
  justify-content: flex-end;
}
.tick {
  font-size: 11px;
  line-height: 1;
}

/* --------------------------------------------------------------- typing -- */
.typing {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  padding: 11px 15px;
  align-self: flex-start;
  background: var(--theirs);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  border-bottom-left-radius: 7px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: rise 0.42s var(--spring) both;
}
.typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-soft);
  animation: bounce 1.25s ease-in-out infinite;
}
.typing i:nth-child(2) {
  animation-delay: 0.16s;
}
.typing i:nth-child(3) {
  animation-delay: 0.32s;
}
@keyframes bounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

/* ---------------------------------------------------------------- empty -- */
.empty {
  margin: auto;
  padding: 20px;
  text-align: center;
  animation: rise 0.7s var(--spring) both;
}
.empty svg {
  width: 172px;
  height: 108px;
  margin-bottom: 6px;
}
.empty h2 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
}
.empty p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
}

/* ------------------------------------------------------------- note bar -- */
.note {
  flex: none;
  margin: 0 12px 8px;
  padding: 10px 14px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink-soft);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: rise 0.4s var(--spring) both;
}
.note[hidden] {
  display: none;
}

/* ------------------------------------------------------------- composer -- */
.composer {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 8px 12px calc(env(safe-area-inset-bottom) + 10px);
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-top: 1px solid var(--line);
  transition: background-color 1.4s ease;
}
.field {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 2px 6px 2px 16px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 92, 147, 0.12);
}
.field textarea {
  flex: 1;
  border: 0;
  outline: 0;
  resize: none;
  background: none;
  padding: 10px 0;
  max-height: 132px;
  font-size: 16px; /* < 16px makes iOS zoom on focus */
  line-height: 1.4;
  color: var(--ink);
}
.field textarea::placeholder {
  color: var(--ink-faint);
}

.send {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, var(--mine-a), var(--mine-b));
  box-shadow: var(--shadow-soft);
  transition: transform 0.28s var(--spring), opacity 0.2s ease;
}
.send svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}
.send:disabled {
  opacity: 0.4;
  box-shadow: none;
}
.send:not(:disabled):active {
  transform: scale(0.86);
}
.send.pop {
  animation: pop 0.45s var(--spring);
}
@keyframes pop {
  40% {
    transform: scale(1.22);
  }
}

/* -------------------------------------------------------------- sparkle -- */
.spark {
  position: fixed;
  z-index: 60;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  pointer-events: none;
  background: var(--accent);
  animation: spark 0.72s var(--spring) forwards;
}
@keyframes spark {
  to {
    transform: translate(var(--dx), var(--dy)) scale(0);
    opacity: 0;
  }
}
.floatheart {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  font-size: 20px;
  animation: floatup 1.5s ease-out forwards;
}
@keyframes floatup {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.5);
  }
  18% {
    opacity: 1;
    transform: translateY(-14px) scale(1.1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx, 0), -110px) scale(0.85);
  }
}

/* ------------------------------------------------------------- overlays -- */
.veil {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: end center;
  background: rgba(60, 30, 45, 0.38);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fade 0.3s ease both;
}
.veil[hidden] {
  display: none;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}

.sheet {
  width: 100%;
  max-width: 480px;
  max-height: 86dvh;
  overflow-y: auto;
  padding: 22px 22px calc(env(safe-area-inset-bottom) + 22px);
  background: var(--bg);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -10px 40px rgba(90, 40, 65, 0.2);
  animation: slideup 0.42s var(--spring) both;
}
@keyframes slideup {
  from {
    transform: translateY(100%);
  }
}
.sheet .grip {
  width: 40px;
  height: 4px;
  margin: -6px auto 16px;
  border-radius: 2px;
  background: var(--line);
}
.sheet h2 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 700;
}
.sheet p {
  margin: 0 0 16px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.sheet .emoji {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 12px;
}

.btns {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.btn {
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 15.5px;
  font-weight: 700;
  text-align: center;
  transition: transform 0.22s var(--spring), opacity 0.2s ease;
}
.btn:active {
  transform: scale(0.97);
}
.btn.primary {
  background: linear-gradient(150deg, var(--mine-a), var(--mine-b));
  color: #fff;
  box-shadow: var(--shadow-soft);
}
.btn.ghost {
  background: var(--glass-strong);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-weight: 600;
}
.btn:disabled {
  opacity: 0.55;
}

/* --------------------------------------------------------------- banner -- */
.banner {
  position: fixed;
  z-index: 65;
  left: 12px;
  right: 12px;
  top: calc(env(safe-area-inset-top) + 10px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: dropin 0.5s var(--spring) both;
}
.banner[hidden] {
  display: none;
}
@keyframes dropin {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
}
.banner .txt {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  line-height: 1.35;
}
.banner .txt b {
  display: block;
  font-weight: 700;
}
.banner .txt span {
  color: var(--ink-soft);
}
.banner .act {
  flex: none;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(150deg, var(--mine-a), var(--mine-b));
}
.banner .dismiss {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--ink-faint);
  font-size: 17px;
  line-height: 1;
}

/* ---------------------------------------------------------- diagnostics -- */
.diag {
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.diag div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--line);
}
.diag div:last-child {
  border-bottom: 0;
}
.diag dt {
  color: var(--ink-soft);
  margin: 0;
}
.diag dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}
.diag .good {
  color: #35a97a;
}
.diag .bad {
  color: var(--accent-ink);
}

/* ------------------------------------------------------------- recovery -- */
.recovery {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 28px;
  text-align: center;
  background: var(--bg);
}
.recovery[hidden] {
  display: none;
}
.recovery .inner {
  max-width: 340px;
  animation: rise 0.6s var(--spring) both;
}
.recovery .emoji {
  font-size: 52px;
  margin-bottom: 14px;
}
.recovery h1 {
  margin: 0 0 10px;
  font-size: 21px;
  font-weight: 700;
}
.recovery p {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.recovery .hint {
  font-size: 13px;
  color: var(--ink-faint);
}

/* -------------------------------------------------------------- toast -- */
.toast {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 84px);
  transform: translateX(-50%);
  max-width: calc(100% - 40px);
  padding: 11px 18px;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  color: var(--mine-ink);
  background: linear-gradient(150deg, var(--mine-a), var(--mine-b));
  border-radius: 999px;
  box-shadow: var(--shadow);
  animation: toastin 0.4s var(--spring) both;
}
.toast[hidden] {
  display: none;
}
@keyframes toastin {
  from {
    opacity: 0;
    transform: translate(-50%, 14px);
  }
}

/* ------------------------------------------------------- accessibility -- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .blob {
    animation: none !important;
  }
}

@media (min-width: 720px) {
  /* Vikta reads this on his laptop too. */
  .app {
    max-width: 680px;
    margin: 0 auto;
    box-shadow: 0 0 80px rgba(255, 143, 177, 0.16);
  }
  .thread {
    padding: 18px 22px 8px;
  }
  .bubble {
    max-width: 68%;
  }
}
