/* Home, from the Stage set "Fling · every Home state", round "Final". Measured at 390 × 844 (phone) and 1180 × 780 (desktop).
   home.js positions devices, zone labels, clouds, arcs and lanes from one layout; this file styles everything else. */
#home { position: relative; width: 100%; height: var(--viewport-height); overflow: hidden; background: #000; color: #f2f6fc;
  --dock-bottom: max(20px, env(safe-area-inset-bottom, 0px)); --side: 24px; font-family: Inter, system-ui, sans-serif; }

/* Field: the Bluetooth glow and arcs, the Wi-Fi clouds, and transfer lanes. */
#field { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; stroke-width: 1; }
#arc-reach, #arc-room, #arcs, #arc-mask-rect, #field-glow-rect { transition: cy .45s ease, y .45s ease; }
#lanes path, #lanes circle { transition: none; }
/* Full strength: the design's 50 % read as almost invisible on phone screens. */
#clouds { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; opacity: 1; isolation: isolate;
  -webkit-mask-image: var(--cloud-mask); mask-image: var(--cloud-mask); -webkit-mask-composite: source-in; mask-composite: intersect; }
.cloud { position: absolute; width: 240px; height: 164px; margin: -82px 0 0 -120px; border-radius: 50%; filter: blur(24px); mix-blend-mode: screen;
  background: radial-gradient(circle 135px, rgb(var(--glow) / .34), rgb(var(--glow) / .22) 40%, rgb(var(--glow) / 0) 100%);
  animation: drift var(--drift, 17s) steps(var(--steps, 34), jump-none) infinite alternate; transition: left .6s ease, top .6s ease, opacity .6s ease;
  /* The drift moves about 7 px in 13 to 27 s. As a smooth animation the web view drew a new frame for it at the screen's
     rate (120 a second on the S24), blurring and blending the cloud each time: with a Wi-Fi-only device listed that
     doubled the S24's CPU (147 % against 64 % of a core without the drift, during a transfer). It moves in steps of
     half a second instead (--steps is the duration over 0.5 s; each step is under 0.3 px), and home.js starts every
     cloud on the same half-second grid, so several clouds step in the same frame: two frames a second in all. The cloud
     keeps its own layer (will-change), which changes no pixel (tests/cloud-layer.mjs). */
  will-change: transform; }
.cloud.base { width: 624px; height: 380px; margin: -190px 0 0 -312px; filter: none; mix-blend-mode: normal; animation: none;
  background: radial-gradient(closest-side, #426aaf29, #426aaf00); }
@keyframes drift { from { transform: translate(-3px, 2px); } to { transform: translate(4px, -3px); } }

/* Heading and this device's name. */
.hd { position: absolute; z-index: 1; left: var(--column-left, 24px); top: max(40px, calc(env(safe-area-inset-top, 0px) + 8px)); margin: 0; }
.hd h1 { margin: 0; font-size: 28px; line-height: 34px; letter-spacing: -1px; font-weight: 600; outline: none; white-space: nowrap; }
.hd h1 b { color: var(--blue); font-weight: 600; }
/* This device's name, under its avatar at the bottom of the arcs; home.js sets left and top. */
.me { position: absolute; z-index: 2; margin: 0; transform: translateX(-50%); font: 600 12px/14px Inter, sans-serif; color: #f2f6fc; white-space: nowrap;
  pointer-events: none; transition: top .45s ease, left .45s ease; }
.me strong { font-weight: inherit; }

/* Zone labels. "Same Wi-Fi" never moves; the other two ride with the Bluetooth field. */
.zone { position: absolute; z-index: 1; margin: 0; font: 600 10px/10px Inter, sans-serif; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; pointer-events: none;
  transition: top .45s ease, left .45s ease; }
.zone.wifi { color: var(--blue); }
.zone.room { color: #7f8fa5; }
.zone.reach { color: var(--green); }

/* This device, at the bottom of the arcs. */
#self-center { position: absolute; z-index: 2; width: 40px; height: 40px; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none;
  box-shadow: 0 0 0 4px #f2f6fc24, 0 0 0 9px #a4c2ff14; transition: top .45s ease, left .45s ease; }
#self-center:not([src]) { visibility: hidden; }

/* Devices. Each <li> sits at its bubble's center; home.js sets left and top. */
#devices { list-style: none; margin: 0; padding: 0; }
.dev { --size: 52px; --avatar: 45px; position: absolute; z-index: 2; width: 1px; height: 1px; transition: left .6s ease, top .6s ease, opacity .4s ease; }
.dev.entering { opacity: 0; }
.device { position: absolute; left: 0; top: 0; transform: translate(-50%, calc(var(--size) / -2)); display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 0; margin: 0; border: 0; background: none; color: inherit; }
.dev.ble:not(.dual) .nm { margin-top: 4px; }
.dev.closest { --size: 64px; --avatar: 57px; }
.bub { position: relative; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center; background: #10151b;
  border: 1.5px dashed #a4c2ff80; transition: width .3s, height .3s, border-color .3s, box-shadow .3s; }
.ready .bub { border-color: #a4c2ffc8; }
.dev.ble .bub { border-style: solid; border-color: #3c536e; }
.dev.ble.ready .bub { border-color: #6d86a6; }
.dev.closest .bub { border-color: var(--green); box-shadow: 0 0 0 6px #a9d7b81a; }
.bub > .avatar { width: var(--avatar); height: var(--avatar); border-radius: 50%; }
.bub > .device-icon { width: 24px; height: 24px; color: #c9d4e3; stroke-width: 1.7; }
.nm { font: 500 12px/16px Inter, sans-serif; color: #c9d4e3; white-space: nowrap; }
.ready .nm, .active .nm { color: #f2f6fc; }
.dev.closest .nm { font-size: 14px; font-weight: 600; }
.st { font: 600 12px/14px Inter, sans-serif; white-space: nowrap; margin-top: -2px; }
/* A transfer lane can pass under a device's name and status; a halo in the page's black keeps the words readable. */
.nm, .st { text-shadow: 0 0 2px #000, 0 0 4px #000, 0 0 8px #000; }
.st:empty { display: none; }
.st + .st { margin-top: -4px; }
.st.pending { color: var(--blue); } .st.done { color: var(--green); } .st.receiving { color: var(--mint); } .st.problem { color: var(--amber); } .st.own { color: var(--own); }
/* Link badges: blue Wi-Fi, lavender Bluetooth, or a lavender "Slow" pill for a device reached only by Bluetooth (not
   for two phones that move large batches onto a hotspot). */
.lk { position: absolute; right: -8px; bottom: -6px; display: flex; gap: 2px; }
.lk > span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 0 0 2px #000; }
.lk svg { width: 12px; height: 12px; }
.lk .w { background: var(--blue); color: #1d3459; } .lk .b { background: var(--lavender); color: #33285a; }
.dev:not(.wifi) .lk .w, .dev:not(.ble) .lk .b, .dev.ble:not(.dual) .lk { display: none; }
.slow { position: absolute; left: 30px; bottom: -6px; display: flex; align-items: center; gap: 3px; height: 20px; padding: 0 8px 0 5px; border-radius: 10px; background: var(--lavender);
  color: #33285a; font: 600 10px/1 Inter, sans-serif; white-space: nowrap; box-shadow: 0 0 0 2px #000; }
.slow svg { width: 12px; height: 12px; }
.dev:not(.ble) .slow, .dev.dual .slow, .dev.hotspot .slow { display: none; }
/* Result badge at the ring's top right. */
.sb { position: absolute; right: -14px; top: -14px; width: 24px; height: 24px; border-radius: 50%; display: none; place-items: center; box-shadow: 0 0 0 2px #000; }
.sb svg { width: 12px; height: 12px; } .sb b { display: none; font: 800 12px/1 Inter, sans-serif; }
.badge-done .sb { display: grid; background: var(--green); color: #18382c; }
.badge-problem .sb { display: grid; background: var(--amber); color: #49321c; } .badge-problem .sb svg { display: none; } .badge-problem .sb b { display: block; }
.badge-save .sb { display: grid; background: var(--blue); color: #1d3459; }
.dev:not(.closest) .sb { right: -10px; top: -10px; }
/* Pending: a turning arc around the ring. */
.pend { position: absolute; inset: -6px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--blue); border-right-color: var(--blue);
  animation: spin 1.6s linear infinite; display: none; }
.pending-ring .pend { display: block; }
/* The labeled pill just right of the ring: Cancel, Stop, Stop both, or Confirm. */
.act { position: absolute; z-index: 3; left: calc(var(--size) / 2 + 6px); top: calc(var(--size) / -2 - 44px); height: 44px; padding: 0 16px 0 13px; border-radius: 22px;
  display: flex; align-items: center; gap: 5px; background: #22344a; border: 1.5px solid #5a7391; color: #e0e9f5; font: 600 13px/1 Inter, sans-serif; white-space: nowrap; box-shadow: 0 0 0 3px #000; }
.act svg { width: 12px; height: 12px; }
.act.confirm { background: linear-gradient(135deg, #dceaff, #bacff1); border-color: #e5efff; color: #234677; }
.device:disabled { cursor: default; }

/* Dock, cards and notes. */
#tray { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; }
.dock, .card, .note { position: absolute; left: var(--side); right: var(--side); border: 1px solid #304258; border-radius: 22px; background: #152132; color: #f2f6fc; }
.dock { bottom: var(--dock-bottom); height: 78px; display: flex; align-items: center; }
.src { flex: 1; display: flex; align-items: center; height: 78px; padding: 8px 0; }
.src button { flex: 1; height: 52px; border: 0; background: none; color: #dce8ff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 2px 6px 3px; font: 500 12px/12px Inter, sans-serif; border-radius: 12px; }
.src button + button { border-left: 1px solid #304258; border-radius: 0; }
.src svg { width: 20px; height: 20px; color: #b6d0f5; }
.files { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 14px; height: 78px; }
.file-summary { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 0; text-align: left; color: inherit; }
.fileicon { width: 40px; height: 46px; border: 1px solid #527195; border-radius: 8px; background: #243a56; display: grid; place-items: center; flex-shrink: 0; color: #b6d0f5; }
.fileicon svg { width: 18px; height: 18px; }
.filetext { flex: 1; min-width: 0; font-size: 13px; line-height: 21px; }
.filetext > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filetext small { display: block; color: #a3b2c6; font-size: 11px; line-height: 21px; }
.plus { width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center; padding: 0; border: 1px solid #42556e; background: none; border-radius: 50%; color: #dce8ff; }
.plus svg { width: 18px; height: 18px; }
.divider { width: 1px; align-self: stretch; margin: 14px 0; background: #304258; }
.plus.options { margin: 0 16px 0 14px; }

.card { bottom: var(--dock-bottom); padding: 14px 16px 16px; }
.card-head { display: flex; align-items: center; gap: 12px; }
.card-head > img { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.card-heading { min-width: 0; flex: 1; }
.card-title { font: 600 15px/1.3 Inter, sans-serif; }
.card-detail { font-size: 12px; color: #8e9eb3; margin-top: 2px; }
.card-actions { display: flex; gap: 10px; margin-top: 12px; }
.btn { height: 48px; border-radius: 14px; font: 600 15px/1 Inter, sans-serif; display: flex; align-items: center; justify-content: center; gap: 8px; flex: 1; padding: 0 14px; }
.btn svg { width: 16px; height: 16px; }
.pri { background: linear-gradient(135deg, #dceaff, #bacff1); color: #234677; border: 1px solid #e5efff; }
.sec { background: #1e2e42; color: #e0e9f5; border: 1px solid #3a5069; }
.btn:disabled { opacity: .45; }
#receipts { list-style: none; margin: 0; padding: 0; }
.receipt { padding: 12px 14px 8px 16px; bottom: calc(var(--dock-bottom) + 86px); z-index: 4; }
.receipt .rows { max-height: 72px; }
.receipt .card-title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.receipt-action { flex: 0 0 auto; height: 44px; }
.dis { width: 32px; height: 32px; margin: -4px -6px 0 0; border-radius: 10px; display: grid; place-items: center; color: #a3b2c6; border: 0; background: none; padding: 0; flex-shrink: 0; }
.dis svg { width: 18px; height: 18px; }
.rows { list-style: none; margin: 6px 0 0; padding: 0; max-height: 125px; overflow-y: auto; }
.row { display: flex; align-items: center; gap: 12px; height: 25px; font-size: 13px; }
.row + .row { border-top: 1px solid #26384d; }
.row .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #c9d4e3; }
.row .p { display: inline-flex; align-items: center; gap: 5px; color: #8e9eb3; font-size: 12px; white-space: nowrap; }
.row .p svg { width: 13px; height: 13px; }
.row .p:not([data-place]), .row .p[data-place=""] { display: none; }

.note { bottom: calc(var(--dock-bottom) + 86px); min-height: 60px; padding: 12px 12px 12px 16px; display: flex; align-items: center; gap: 12px; z-index: 4; }
.note-icon { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: #b6cdf5; color: #1d3459; }
.note-icon svg { width: 14px; height: 14px; } .note-icon b { display: none; font: 800 14px/1 Inter, sans-serif; }
.note-text { flex: 1; min-width: 0; }
.note-title { font: 600 14px/1.3 Inter, sans-serif; color: #f2f6fc; }
.note-detail { font-size: 12px; line-height: 1.35; color: #cbb3a3; margin-top: 2px; }
.note-button { height: 36px; padding: 0 14px; border-radius: 12px; border: 1px solid #3a5069; background: none; color: #dce8ff; font: 600 13px/1 Inter, sans-serif; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.note-button svg { width: 14px; height: 14px; }
.note.problem { border-color: #6b5546; background: #241d19; }
.note.problem .note-icon { background: var(--amber); color: #49321c; } .note.problem .note-icon svg { display: none; } .note.problem .note-icon b { display: block; }
.note.problem .note-title { color: #ffe0cb; } .note.problem .note-button { border-color: #836555; color: #ffe0cb; }
.note.drop { border-color: #4a6fa8; background: #18294a; } .note.drop .note-icon { background: var(--blue); }
#drop-frame { position: absolute; inset: 6px; border: 2px dashed #a4c2ffb3; border-radius: 36px; background: #4a80ff0f; z-index: 5; pointer-events: none; }

/* Desktop connection options. */
dialog { width: min(440px, calc(100% - 32px)); border: 1px solid #304258; border-radius: 24px; background: #152132; padding: 26px; color: #f2f6fc; }
dialog::backdrop { background: #000000f0; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
dialog h2 { margin: 0 0 6px; font: 600 20px/1.3 Inter, sans-serif; }
.dialog-lead { margin: 0 0 14px; font-size: 14px; color: #a3b2c6; }
.option { display: flex; gap: 16px; padding: 14px 0; border-top: 1px solid #26384d; cursor: pointer; }
.option-text { flex: 1; } .option-title { display: block; font: 600 15px/1.3 Inter, sans-serif; }
.option-note { display: block; font-size: 13px; line-height: 1.5; color: #a3b2c6; margin-top: 4px; }
.option input { appearance: none; flex-shrink: 0; width: 44px; height: 26px; margin: 2px 0 0; border-radius: 13px; background: #3a3f47; border: 1px solid #5b626c; position: relative; cursor: pointer; transition: background .2s; }
.option input::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #c9ced6; transition: translate .2s; }
.option input:checked { background: #3d6bb3; border-color: #7aa3e6; } .option input:checked::after { translate: 18px 0; background: #fff; }
#options-error { color: #ffe0cb; font-size: 13px; margin: 8px 0 0; }
#close-options { width: 100%; margin-top: 10px; }

/* Desktop window: one centered column, a narrower dock. */
@media (min-width: 700px) {
  #home { --side: calc(50% - 230px); }
  .hd { top: 44px; }
  .note { left: calc(50% - 230px); right: calc(50% - 230px); }
}
@media (max-width: 359px) { #home { --side: 16px; } .hd h1 { font-size: 26px; } }
@media (prefers-reduced-motion: reduce) { .cloud, .pend { animation: none; } }
/* Nothing decorative moves while Home is hidden (a minimized desktop window keeps running: background throttling is off). */
.page-hidden .cloud, .page-hidden .pend { animation-play-state: paused; }
