:root {
  color-scheme: light;
  --ink: #19234a;
  --muted: #68728e;
  --blue: #355bf2;
  --line: #d9e1f4;
  --paper: #f9fbff;
  --pale: #edf3ff;
  --green: #168a65;
}
* {
  box-sizing: border-box;
}
html {
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: #edf3ff;
  color: var(--ink);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 75% 50% at 75% 0%, #dce8ff 0%, transparent 75%),
    var(--pale);
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible,
input:focus-visible,
.drop-zone:focus-within {
  outline: 3px solid #7594ff;
  outline-offset: 3px;
}
.shell {
  max-width: 1160px;
  min-height: 100vh;
  margin: auto;
  padding: 31px 52px 24px;
  display: flex;
  flex-direction: column;
}
.topbar,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  font-size: 22px;
  font-weight: 790;
  letter-spacing: -0.065em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-right: 10px;
  border-radius: 9px;
  background: var(--blue);
  color: #fff;
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
}
.brand-dot {
  color: var(--blue);
}
.ticket-label,
.invite-block label,
.input-label {
  font-size: 13px;
  font-weight: 650;
}
.top-link {
  padding: 9px 15px;
  border: 1px solid #ccd8f4;
  border-radius: 99px;
  background: #f7faff;
  color: var(--blue);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}
.top-link:hover {
  background: #fff;
  border-color: #aabcef;
}
.intro {
  max-width: 670px;
  margin: 74px 0 48px;
}
.intro h1 {
  font-size: clamp(56px, 7.8vw, 102px);
  line-height: 0.98;
  letter-spacing: -0.055em;
  font-weight: 780;
  margin: 20px 0 22px;
}
.intro p {
  max-width: 520px;
  color: #64708e;
  line-height: 1.65;
  font-size: 18px;
  margin: 0;
}
.panel {
  background: var(--paper);
  border: 1px solid #dce4f5;
  border-radius: 21px;
  box-shadow: 0 24px 70px #4766a01a;
  padding: 35px 38px 30px;
  max-width: 855px;
  margin-bottom: 80px;
}
.panel h2 {
  font-size: 31px;
  letter-spacing: -0.05em;
  margin: 15px 0 7px;
}
.muted {
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}
/* The code reads across the top; the QR code and copy buttons sit side by
   side under it, so all of it fits in the first screen. */
.ticket {
  margin: 26px 0 25px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "info info"
    "qr actions";
  align-items: center;
  gap: 20px 26px;
  padding: 25px 27px;
  background: #eaf0ff;
  border: 1px dashed #aabcef;
  border-radius: 14px;
}
.ticket-info {
  grid-area: info;
  min-width: 0;
}
.ticket-actions {
  grid-area: actions;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 240px;
}
.qr-card {
  grid-area: qr;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 10px 9px;
  border-radius: 11px;
  background: #fff;
}
.qr-card img {
  display: block;
  width: 168px;
  height: 168px;
  image-rendering: pixelated;
}
.qr-card span {
  margin-top: 7px;
  color: #657bb8;
  font-size: 12px;
  font-weight: 650;
}
.ticket-label {
  display: block;
  color: #657bb8;
  margin-bottom: 6px;
}
.room-code {
  display: block;
  font-size: clamp(27px, 5vw, 43px);
  letter-spacing: 0.14em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #2245bd;
}
.subtle-button {
  background: transparent;
  color: var(--blue);
  border: 1px solid #bac9ee;
  border-radius: 9px;
  padding: 11px 14px;
  font-weight: 700;
  white-space: nowrap;
}
.subtle-button:hover {
  background: #f5f8ff;
}
.invite-block label,
.input-label {
  display: block;
  color: #66759e;
  margin-bottom: 10px;
}
.invite-options {
  display: block;
  width: 100%;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
}
.link-row {
  display: flex;
  gap: 9px;
}
.link-row input {
  min-width: 0;
  flex: 1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 15px;
  color: #3d4d78;
}
.primary-button {
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font-weight: 750;
  padding: 13px 19px;
  white-space: nowrap;
}
.primary-button:hover {
  background: #2249db;
}
.hint {
  color: #8390aa;
  font-size: 12px;
  line-height: 1.5;
  margin: 10px 0 0;
}
.list-heading {
  border-top: 1px solid var(--line);
  margin: 29px 0 0;
  padding-top: 25px;
  letter-spacing: -0.035em;
  font-size: 22px;
}
.list-heading span {
  font-size: 14px;
  color: #8593b4;
  font-weight: 500;
  letter-spacing: 0;
}
.file-list {
  margin-top: 16px;
}
.empty {
  border: 1px dashed var(--line);
  border-radius: 11px;
  padding: 27px;
  color: #8b97ae;
  text-align: center;
  font-size: 14px;
  margin: 0;
}
.file-row,
.transfer-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid #e7ecf7;
}
.file-row:last-child,
.transfer-row:last-child {
  border-bottom: 0;
}
.file-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #eaf0ff;
  color: var(--blue);
  font-size: 21px;
}
.file-detail {
  min-width: 0;
  flex: 1;
}
.file-name {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-meta {
  display: block;
  color: #8995ad;
  font-size: 12px;
  margin-top: 4px;
}
.download {
  flex: none;
  color: var(--blue);
  text-decoration: none;
  font-size: 13px;
  font-weight: 750;
}
.download:hover {
  text-decoration: underline;
}
.code-input::placeholder {
  color: #a3aecb;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
}
.code-input {
  width: 100%;
  border: 1px solid #bdcbee;
  border-radius: 10px;
  padding: 15px 17px;
  background: #fff;
  letter-spacing: 0.16em;
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
  color: var(--ink);
}
.input-label {
  margin-top: 28px;
}
/* Choosing files is the main action on this page, so it reads as the
   primary button: one tap on a phone, a drop target on a computer. */
.drop-zone {
  position: relative;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  min-height: 168px;
  margin-top: 22px;
  padding: 28px 20px;
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(120% 85% at 50% -15%, #7b97ff 0%, transparent 62%),
    linear-gradient(180deg, #3e63f6 0%, #2d4fe2 100%);
  color: #fff;
  box-shadow:
    inset 0 1px 0 #ffffff47,
    inset 0 -1px 0 #0b1a6a1f,
    0 2px 6px #355bf22e,
    0 18px 36px -14px #355bf28c;
  transition:
    background 0.18s,
    box-shadow 0.18s,
    transform 0.12s;
}
.drop-zone:hover {
  filter: brightness(1.05);
}
.drop-zone:active {
  transform: scale(0.99);
}
/* On computers a faint inner outline hints that files can be dropped. */
@media (pointer: fine) {
  .drop-zone::before {
    content: "";
    position: absolute;
    inset: 9px;
    border: 1.5px dashed #ffffff3d;
    border-radius: 12px;
    pointer-events: none;
    transition: border-color 0.18s;
  }
}
.drop-zone.dragging {
  background: linear-gradient(180deg, #2f52e8 0%, #2341cc 100%);
}
.drop-zone.dragging::before {
  border-color: #ffffffcc;
}
.drop-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fff;
  color: var(--blue);
  box-shadow:
    0 0 0 10px #ffffff1c,
    0 0 0 22px #ffffff0d,
    0 8px 18px #10237a4d;
  transition: transform 0.2s;
}
.drop-zone.dragging .drop-icon {
  transform: translateY(-3px);
}
.drop-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.drop-zone strong {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.drop-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.transfer-list {
  margin-top: 10px;
}
.transfer-row progress {
  width: 100%;
  height: 5px;
  appearance: none;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #dce5fa;
  margin-top: 8px;
}
.transfer-row progress::-webkit-progress-bar {
  background: #dce5fa;
}
.transfer-row progress::-webkit-progress-value {
  background: var(--blue);
}
.transfer-row progress::-moz-progress-bar {
  background: var(--blue);
}
.transfer-row.error .file-meta {
  color: #c04747;
}
footer {
  margin-top: auto;
  border-top: 1px solid #d2def1;
  padding-top: 20px;
  color: #8a97b1;
  font-size: 12px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 650;
  transition:
    opacity 0.2s,
    transform 0.2s;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
[hidden] {
  display: none !important;
}
@media (max-width: 700px) {
  .shell {
    padding: 20px 18px;
  }
  .brand {
    font-size: 20px;
  }
  .top-link {
    padding: 8px 13px;
    font-size: 13px;
  }
  .panel {
    padding: 24px 19px;
    margin-bottom: 56px;
    border-radius: 17px;
  }
  /* A shorter intro, so the room code and QR code are on the first screen. */
  .intro {
    margin: 30px 0 22px;
  }
  .intro h1 {
    font-size: clamp(38px, 11vw, 50px);
    margin: 12px 0 0;
  }
  .intro p,
  .panel > .muted {
    display: none;
  }
  .panel h2 {
    font-size: 25px;
    margin: 12px 0 0;
  }
  /* On phones the code, QR code and buttons stack, centered. */
  .ticket {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "info" "qr" "actions";
    justify-items: center;
    gap: 16px;
    margin: 18px 0 22px;
    padding: 20px 16px;
    text-align: center;
  }
  .qr-card img {
    width: 148px;
    height: 148px;
  }
  .ticket-actions {
    flex-direction: row;
    width: 100%;
    max-width: none;
  }
  .ticket-actions button {
    flex: 1;
    min-width: 0;
    padding: 13px 10px;
    white-space: normal;
  }
  .room-code {
    font-size: clamp(26px, 8vw, 36px);
  }
  .list-heading {
    font-size: 20px;
  }
  .drop-zone {
    min-height: 140px;
  }
  .link {
    margin-bottom: 16px;
  }
  .link-status {
    font-size: 12px;
  }
  footer {
    gap: 20px;
    line-height: 1.4;
  }
}
@media (max-width: 359px) {
  .qr-card img {
    width: 124px;
    height: 124px;
  }
  .ticket-actions button {
    font-size: 14px;
    white-space: nowrap;
  }
}
/* Short phones: tighten the top so the room card still fits. */
@media (max-width: 700px) and (max-height: 700px) {
  .intro {
    margin: 18px 0 14px;
  }
  .link {
    margin-bottom: 8px;
  }
  .ticket {
    gap: 12px;
    margin-top: 14px;
  }
  .qr-card img {
    width: 128px;
    height: 128px;
  }
  .intro h1 {
    font-size: 34px;
  }
}
/* Wide screens: the intro on the left, the room on the right, both in view. */
@media (min-width: 980px) {
  .shell {
    max-width: 1240px;
  }
  main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 540px);
    gap: 64px;
    align-items: start;
  }
  .intro {
    position: sticky;
    top: 40px;
    margin: 72px 0 0;
  }
  .intro h1 {
    font-size: clamp(64px, 6.6vw, 96px);
  }
  .panel {
    max-width: none;
    margin: 40px 0 64px;
  }
  .room-code {
    font-size: clamp(30px, 3vw, 40px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .drop-zone,
  .toast {
    transition: none;
  }
}
.hint-link,
.hint button {
  color: var(--blue);
  font-weight: 700;
}
.hint button {
  border: 0;
  padding: 0;
  background: none;
  font-size: inherit;
  text-decoration: underline;
}
/* Netlify injects a "Powered by Netlify" badge and an owner toolbar. */
#nl-badge-frame,
#nl-hud-frame {
  display: none !important;
}
.mode-picker {
  border: 0;
  margin: 24px 0 0;
  padding: 0;
  min-width: 0;
}
.mode-picker legend {
  padding: 0;
  margin-top: 0;
}
.mode-picker:disabled .tabs {
  opacity: 0.55;
}
.mode-picker:disabled label,
.mode-picker:disabled input {
  cursor: not-allowed;
}
.row-actions {
  display: flex;
  flex: none;
  gap: 6px;
}
.row-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #bac9ee;
  border-radius: 9px;
  background: #fff;
  color: var(--blue);
}
.row-button:hover {
  background: #f5f8ff;
}
.row-button svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}
.transfer-row.paused progress::-webkit-progress-value {
  background: #9fb0dd;
}
.transfer-row.paused progress::-moz-progress-bar {
  background: #9fb0dd;
}
.transfer-row.cancelled .file-icon {
  background: #eef1f7;
  color: #8995ad;
}
.ask {
  width: min(420px, calc(100vw - 32px));
  padding: 26px 26px 22px;
  border: 1px solid #dce4f5;
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 30px 80px #2a3f7a40;
}
.ask::backdrop {
  background: #19234a59;
  backdrop-filter: blur(3px);
}
.ask-name {
  margin: 12px 0 4px;
  font-size: 22px;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}
.ask-meta {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}
.ask-trust {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  color: #4b5a80;
  font-size: 13px;
  cursor: pointer;
}
.ask-trust input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}
.ask-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
/* The connection line: this device on the left, the other on the right.
   The track shows the state: dashed while waiting, marching while
   connecting, drawn solid once connected, with a relay stop in the middle
   when the route goes through it, and dots flowing while files move. */
.link {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: start;
  gap: 12px;
  margin-bottom: 22px;
}
.node {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1.5px solid var(--blue);
  border-radius: 13px;
  background: var(--blue);
  color: #fff;
  transition:
    background 0.3s,
    border-color 0.3s,
    color 0.3s;
}
.node svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.node-here .icon-phone {
  display: none;
}
@media (pointer: coarse) {
  .node-here .icon-laptop {
    display: none;
  }
  .node-here .icon-phone {
    display: block;
  }
}
.node-here::after {
  content: "";
  position: absolute;
  inset: -1.5px;
  border: 2px solid var(--blue);
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
}
.node-there {
  border-style: dashed;
  border-color: #b3c2e8;
  background: transparent;
  color: #9aa9cf;
}
.link-mid {
  min-width: 0;
}
.link-track {
  position: relative;
  height: 2px;
  margin-top: 20px;
  border-radius: 2px;
  background: repeating-linear-gradient(90deg, #b3c2e8 0 5px, transparent 5px 11px);
}
.link-track::before,
.link-track::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  border-radius: inherit;
}
.link-track::before {
  top: 0;
  bottom: 0;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
  transition:
    transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
    background 0.3s;
}
.link-track::after {
  top: -1px;
  height: 4px;
  opacity: 0;
  background: linear-gradient(90deg, transparent, #7f9cff 70%, #fff) no-repeat;
  background-size: 38% 100%;
  filter: drop-shadow(0 0 4px #4f72ff) drop-shadow(0 0 1px #355bf2);
  transition: opacity 0.3s;
}
.link-relay {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 1.5px solid var(--blue);
  border-radius: 50%;
  background: var(--paper);
  color: var(--blue);
  transform: scale(0);
  transition: transform 0.35s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.link-relay svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}
.link-status {
  display: block;
  margin-top: 13px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link[data-state="waiting"] .node-here::after {
  animation: link-ring 2.4s ease-out infinite;
}
.link[data-state="connecting"] .link-track {
  animation: link-march 0.7s linear infinite;
}
.link[data-state="connecting"] .node-there {
  border-color: var(--blue);
  color: var(--blue);
}
.link[data-state="direct"] .link-track::before,
.link[data-state="relay"] .link-track::before {
  transform: scaleX(1);
}
.link[data-state="direct"] .node-there,
.link[data-state="relay"] .node-there {
  border-style: solid;
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  transition-delay: 0.45s;
  animation: link-pop 0.45s 0.45s both;
}
.link[data-state="direct"] .link-status,
.link[data-state="relay"] .link-status {
  color: var(--ink);
}
.link[data-state="relay"] .link-relay {
  transform: scale(1);
  transition-delay: 0.3s;
}
.link[data-flow="in"] .link-track::before,
.link[data-flow="out"] .link-track::before {
  background: #c4d2f7;
}
.link[data-flow="in"] .link-track::after,
.link[data-flow="out"] .link-track::after {
  opacity: 1;
  animation: link-stream 1.1s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
.link[data-flow="in"] .link-track::after {
  background-image: linear-gradient(270deg, transparent, #7f9cff 70%, #fff);
  animation-direction: reverse;
}
/* The receiving device glows faintly as each streak arrives. */
.link[data-flow="out"] .node-there,
.link[data-flow="in"] .node-here {
  animation: link-arrive 1.1s ease-in infinite;
}
.link[data-state="idle"] .node-here {
  border-color: #aab4cb;
  background: #aab4cb;
}
.link[data-state="idle"] .link-track {
  background: repeating-linear-gradient(90deg, #cfd6e6 0 5px, transparent 5px 11px);
}
@keyframes link-ring {
  from {
    opacity: 0.55;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(1.65);
  }
}
@keyframes link-march {
  to {
    background-position-x: 11px;
  }
}
@keyframes link-stream {
  from {
    background-position-x: -62%;
  }
  to {
    background-position-x: 162%;
  }
}
@keyframes link-arrive {
  0%,
  70% {
    box-shadow: 0 0 0 0 #355bf200;
  }
  85% {
    box-shadow: 0 0 0 6px #355bf22e;
  }
  100% {
    box-shadow: 0 0 0 9px #355bf200;
  }
}
@keyframes link-pop {
  0% {
    transform: scale(0.85);
  }
  60% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .link *,
  .link *::before,
  .link *::after {
    animation: none !important;
    transition: none !important;
  }
}
.ask-lead {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.ask-name {
  margin-top: 6px;
}
/* Full-screen view while two devices connect: the page blurs behind a
   large connection line, which completes before the view fades away. */
.linking {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: #edf3ffbf;
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  animation: linking-in 0.25s ease-out both;
}
.linking.closing {
  opacity: 0;
  transition: opacity 0.3s;
}
.linking-inner {
  display: grid;
  justify-items: center;
  gap: 34px;
  width: min(460px, 100%);
  animation: linking-rise 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.linking .link {
  width: 100%;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  gap: 16px;
  margin: 0;
}
.linking .node {
  width: 72px;
  height: 72px;
  border-width: 2px;
  border-radius: 22px;
}
.linking .node svg {
  width: 32px;
  height: 32px;
  stroke-width: 1.5;
}
.linking .link-track {
  height: 3px;
  margin-top: 34.5px;
}
.linking .link-relay {
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
}
.linking .link-relay svg {
  width: 20px;
  height: 20px;
}
.linking .link-status {
  margin-top: 26px;
  color: #4b5a80;
  font-size: 18px;
  letter-spacing: -0.01em;
  white-space: normal;
}
.linking .subtle-button {
  min-width: 140px;
  background: #fff;
}
@keyframes linking-in {
  from {
    opacity: 0;
  }
}
@keyframes linking-rise {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
}
@media (max-width: 420px) {
  .linking .link {
    grid-template-columns: 60px minmax(0, 1fr) 60px;
    gap: 10px;
  }
  .linking .node {
    width: 60px;
    height: 60px;
    border-radius: 18px;
  }
  .linking .node svg {
    width: 28px;
    height: 28px;
  }
  .linking .link-track {
    margin-top: 28.5px;
  }
  .linking .link-status {
    font-size: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .linking,
  .linking-inner {
    animation: none;
  }
}
/* Connection choice: a segmented control. A white thumb slides to the
   chosen option. */
.tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px;
  border-radius: 14px;
  background: #e8eef9;
}
.tab-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc((100% - 8px) / 3);
  border-radius: 10px;
  background: #fff;
  box-shadow:
    0 1px 2px #19234a14,
    0 6px 16px #19234a14;
  transition: transform 0.3s cubic-bezier(0.3, 0.9, 0.3, 1);
}
.tabs[data-mode="direct"] .tab-thumb {
  transform: translateX(100%);
}
.tabs[data-mode="relay"] .tab-thumb {
  transform: translateX(200%);
}
.tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 6px;
  border-radius: 10px;
  color: #5d6b90;
  text-align: center;
  cursor: pointer;
  transition: color 0.2s;
}
.tab:hover {
  color: var(--ink);
}
.tab input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.tab:has(input:focus-visible) {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}
.tab-icon {
  display: grid;
  flex: none;
  place-items: center;
}
.tab-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tab-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-wrap: balance;
}
.tab input:checked ~ .tab-name {
  color: var(--ink);
}
.tab input:checked ~ .tab-icon {
  color: var(--blue);
}
.mode-picker:disabled .tab {
  cursor: not-allowed;
}
/* Phones: a smaller icon and tighter gap leave room on both sides of the
   label, so the longest one doesn't touch the thumb's edges. */
@media (max-width: 700px) {
  .tab {
    gap: 6px;
    padding: 8px 12px;
  }
  .tab-icon svg {
    width: 16px;
    height: 16px;
  }
  .tab-name {
    font-size: 13px;
  }
}
@media (max-width: 400px) {
  .tab {
    gap: 5px;
    padding: 8px;
  }
  .tab-icon svg {
    width: 15px;
    height: 15px;
  }
  .tab-name {
    font-size: 12.5px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tab-thumb {
    transition: none;
  }
}
.room-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #eef2fb;
  color: var(--muted);
  font-size: 14px;
}
.room-line strong {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.12em;
}
.room-line button {
  margin-left: auto;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--blue);
  font-weight: 650;
}
.room-line button:hover {
  text-decoration: underline;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.top-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #ccd8f4;
  border-radius: 50%;
  background: #f7faff;
  color: #6b7aa3;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}
.top-icon:hover {
  background: #fff;
  border-color: #aabcef;
}
.top-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.top-icon[aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}
.top-icon[aria-pressed="true"] svg path:first-child {
  fill: currentColor;
}
@media (max-width: 700px) {
  .top-icon {
    width: 36px;
    height: 36px;
  }
}
.code-row {
  display: flex;
  gap: 10px;
}
.code-row .code-input {
  flex: 1;
  min-width: 0;
}
.code-row .primary-button {
  flex: none;
  padding: 0 24px;
}
.primary-button:disabled {
  background: #c3cff2;
  cursor: not-allowed;
}
@media (max-width: 400px) {
  .code-row .primary-button {
    padding: 0 16px;
  }
}
/* Nearby: a radar with this device at the centre and rooms on the same
   network around it. A slow pulse shows it's looking. */
.nearby {
  margin-top: 18px;
}
.radar {
  position: relative;
  height: 236px;
  overflow: hidden;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 50%, #eef3ff 0%, #f6f8fe 60%, #f9fbff 100%);
  border: 1px solid #e3e9f7;
}
.radar-ring,
.radar-ping {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.radar-ring {
  border: 1px solid #d6e0f6;
}
.radar-ring:nth-child(1) {
  width: 140px;
  height: 140px;
}
.radar-ring:nth-child(2) {
  width: 214px;
  height: 214px;
  border-style: dashed;
}
.radar-ping {
  width: 52px;
  height: 52px;
  border: 1.5px solid var(--blue);
  opacity: 0;
  animation: radar-ping 2.6s ease-out infinite;
}
.radar-me {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--blue);
  color: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 6px 16px #355bf247;
}
.radar-me svg,
.radar-device-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.radar-me .icon-phone {
  display: none;
}
@media (pointer: coarse) {
  .radar-me .icon-laptop {
    display: none;
  }
  .radar-me .icon-phone {
    display: block;
  }
}
.radar-device {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 92px;
  margin: -23px 0 0 -46px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  animation: radar-arrive 0.4s cubic-bezier(0.3, 1.4, 0.5, 1) both;
}
.radar-device-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1.5px solid #c9d6f6;
  border-radius: 14px;
  background: #fff;
  color: var(--blue);
  box-shadow: 0 4px 12px #19234a14;
  transition:
    transform 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
}
.radar-device:hover .radar-device-icon,
.radar-device:focus-visible .radar-device-icon {
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px #355bf233;
}
.radar-device:focus-visible {
  outline: none;
}
.radar-device-name {
  max-width: 100%;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nearby-status {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.hint .link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
@keyframes radar-ping {
  from {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(4.4);
  }
}
@keyframes radar-arrive {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
}
@media (prefers-reduced-motion: reduce) {
  .radar-ping,
  .radar-device {
    animation: none;
  }
}
/* The host's smaller drop area for sending back to a device. */
.drop-zone.compact {
  flex-direction: row;
  gap: 14px;
  min-height: 0;
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 14px;
}
.drop-zone.compact .drop-icon {
  width: 40px;
  height: 40px;
  box-shadow: 0 4px 10px #10237a40;
}
.drop-zone.compact .drop-icon svg {
  width: 20px;
  height: 20px;
}
.drop-zone.compact strong {
  font-size: 16px;
}
@media (pointer: fine) {
  .drop-zone.compact::before {
    inset: 6px;
    border-radius: 10px;
  }
}
.send-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.send-target {
  padding: 8px 14px;
  border: 1px solid #ccd8f4;
  border-radius: 99px;
  background: #fff;
  color: var(--muted);
  font-weight: 600;
}
.send-target[aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}
.scan-button {
  display: grid;
  flex: none;
  place-items: center;
  width: 54px;
  padding: 0;
  border: 1px solid #bdcbee;
  border-radius: 10px;
  background: #fff;
  color: var(--blue);
  transition:
    background 0.15s,
    border-color 0.15s;
}
.scan-button:hover {
  border-color: var(--blue);
  background: #f5f8ff;
}
.scan-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* The camera view for scanning the host's QR code. */
.scanner {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: #0d1533e6;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: linking-in 0.2s ease-out both;
}
.scanner-inner {
  display: grid;
  justify-items: center;
  gap: 22px;
  width: min(340px, 100%);
}
.scanner-view {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 24px;
  background: #000;
  box-shadow: 0 24px 60px #00000066;
}
.scanner-view video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scanner-frame {
  position: absolute;
  inset: 16%;
  border: 2px solid #ffffffd9;
  border-radius: 18px;
  box-shadow: 0 0 0 999px #0000004d;
}
.scanner-frame::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 10%;
  height: 2px;
  border-radius: 2px;
  background: #8ea8ff;
  box-shadow: 0 0 12px #6f8dff;
  animation: scanner-line 2s ease-in-out infinite alternate;
}
.scanner-hint {
  margin: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}
.scanner .subtle-button {
  min-width: 140px;
  border-color: #ffffff4d;
  background: #ffffff14;
  color: #fff;
}
@keyframes scanner-line {
  to {
    top: 88%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .scanner,
  .scanner-frame::after {
    animation: none;
  }
}
.you-are {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 10px 0 0;
  padding: 6px 12px 6px 8px;
  border-radius: 99px;
  background: #eef2fb;
  color: var(--muted);
  font-size: 13px;
}
.you-are svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.you-are strong {
  color: var(--ink);
  font-weight: 650;
}
/* Phones: room for all ten characters beside the camera and Connect. */
@media (max-width: 700px) {
  .code-row {
    gap: 8px;
  }
  .code-row .code-input {
    padding: 14px 12px;
    font-size: 15.5px;
    letter-spacing: 0.07em;
  }
  .code-row .primary-button {
    padding: 0 15px;
  }
  .scan-button {
    width: 50px;
  }
}
@media (max-width: 400px) {
  .code-row {
    gap: 6px;
  }
  .code-row .code-input {
    padding: 14px 10px;
    font-size: 14.5px;
    letter-spacing: 0.04em;
  }
  .code-row .primary-button {
    padding: 0 12px;
  }
  .scan-button {
    width: 46px;
  }
}
