:root {
  color-scheme: dark;
  font: 16px/1.5 "Inter", system-ui, sans-serif;
  color: #f0f4f1;
  background: #101817;
  --muted: #aebeba;
  --mint: #98ebc3;
  --line: #334743;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100svh;
  background: radial-gradient(ellipse at 53% 30%, #1e302c 0, transparent 57%), #101817;
}
.top {
  width: min(100% - 3rem, 1320px);
  min-height: 5rem;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #34423e;
}
.brand { display: inline-flex; gap: .65rem; align-items: center; text-decoration: none; color: inherit; font-weight: 650; }
.brand-mark { display: inline-block; width: 1.28rem; height: 1.28rem; border: 1px solid #a7f2ca; border-radius: 50% 50% 46% 54%; box-shadow: inset 0 0 0 4px #213931; background: #79d9a9; }
.motion {
  font: inherit;
  font-size: .82rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2rem;
  padding: .4rem .85rem;
  cursor: pointer;
}
.layout {
  min-height: calc(100svh - 5rem);
  width: min(100% - 3rem, 1270px);
  margin: auto;
  display: grid;
  grid-template: "sync signin pulse" / minmax(0, 1fr) minmax(19rem, 24rem) minmax(0, 1fr);
  gap: clamp(1.4rem, 3vw, 3.2rem);
  align-items: center;
  padding: 3rem 0 5rem;
}
.signin {
  grid-area: signin;
  z-index: 1;
  padding: clamp(1.65rem, 3.2vw, 2.6rem);
  background: #202c29;
  border: 1px solid #48645a;
  border-radius: 1.4rem;
  box-shadow: 0 1.3rem 3.5rem #0a110fa0;
}
h1 { margin: 0; font-size: 2.2rem; line-height: 1.1; letter-spacing: -.05em; }
.intro { color: var(--muted); font-size: .94rem; margin: .7rem 0 1.8rem; }
label { display: block; margin: .95rem 0 .32rem; font-size: .86rem; font-weight: 600; }
input {
  display: block;
  width: 100%;
  min-height: 2.85rem;
  padding: .65rem .8rem;
  font: inherit;
  color: inherit;
  border: 1px solid #557268;
  border-radius: .55rem;
  background: #121c19;
}
.submit {
  width: 100%;
  min-height: 2.85rem;
  margin-top: 1.6rem;
  padding: .65rem .8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--mint);
  color: #142b22;
  border: 0;
  border-radius: .55rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.submit:disabled { opacity: .65; cursor: default; }
:focus-visible { outline: 2px solid #b3f9d5; outline-offset: 3px; }
#status { color: #ffddba; font-size: .85rem; margin: .65rem 0 0; }
#status:empty { display: none; }
.preview { margin: 0; }
.preview-sync { grid-area: sync; }
.preview-pulse { grid-area: pulse; }
.scene {
  position: relative;
  height: 17rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 1.25rem;
  border: 1px solid var(--line);
}
.sync-scene { background: radial-gradient(ellipse at 45% 100%, #29483a, #182520 74%); }
.pulse-scene { background: radial-gradient(ellipse at 63% 100%, #414336, #232a24 73%); }
figcaption { padding: 1rem .15rem 0; }
figcaption h2 { margin: 0; font-size: 1.08rem; letter-spacing: -.02em; }
figcaption p { margin: .3rem 0 0; color: var(--muted); font-size: .875rem; }
.device {
  width: 40%;
  max-width: 8rem;
  padding: .55rem .5rem .65rem;
  background: #0d1815;
  border: 1px solid #668c7d;
  border-radius: 1rem;
  box-shadow: 0 .6rem 2rem #080e0ca0;
}
.device-speaker { margin: 0 auto .7rem; width: 1.4rem; height: .15rem; border-radius: 1rem; background: #61756d; }
.device-title { margin: .2rem 0 .5rem; font-size: .69rem; font-weight: 700; }
.source-item { display: flex; align-items: center; gap: .35rem; margin: .32rem 0; padding: .29rem .3rem; border-radius: .4rem; background: #263b32; font-size: .64rem; white-space: nowrap; }
.source-item i { width: .85rem; text-align: center; font-style: normal; color: #a8eac5; }
.transfer { position: relative; height: 1px; width: 15%; min-width: .9rem; background: #637b6c; }
.signal { position: absolute; left: 0; top: -.2rem; width: .4rem; height: .4rem; border-radius: 50%; background: #b3f9d5; box-shadow: 0 0 .6rem #b3f9d5; animation: transfer 6s ease-in-out infinite; }
.mirror-device {
  width: 35%;
  max-width: 7rem;
  display: grid;
  justify-items: center;
  padding: .85rem .25rem;
  gap: .28rem;
  font-size: .67rem;
  border: 1px solid #587667;
  border-radius: .72rem;
  background: #233831;
  white-space: nowrap;
}
.mirror-device strong { color: var(--mint); font-size: .65rem; animation: confirm 6s ease-in-out infinite; }
.pulse-panel { width: 86%; max-width: 17rem; padding: .85rem; background: #15221d; border: 1px solid #607264; border-radius: .8rem; box-shadow: 0 .6rem 2rem #080e0ca0; }
.pulse-head, .pulse-tabs, .axis { display: flex; align-items: center; justify-content: space-between; gap: .3rem; }
.pulse-head strong { font-size: .95rem; }
.pulse-head span { color: #c3cfca; font-size: .62rem; }
.pulse-tabs { margin-top: .65rem; font-size: .63rem; color: #c2ccc7; }
.pulse-tabs span:first-child { color: var(--mint); }
.pulse-measure { position: relative; display: grid; margin-top: .8rem; }
.pulse-measure span, .pulse-measure small { color: #c2ccc7; font-size: .66rem; }
.pulse-measure strong { font-weight: 650; font-size: 1.36rem; line-height: 1.2; }
.pulse-measure small { position: absolute; bottom: 0; right: 0; }
.chart { display: flex; align-items: end; gap: 6%; height: 3.8rem; margin-top: .45rem; border-bottom: 1px solid #647467; }
.bar { width: 10%; height: var(--height); border-radius: .22rem .22rem 0 0; background: linear-gradient(#83dbaf, #438369); transform-origin: bottom; animation: trend 7s ease-in-out infinite; }
.bar-mon { --height: 43%; }
.bar-tue { --height: 57%; animation-delay: .12s; }
.bar-wed { --height: 40%; animation-delay: .24s; }
.bar-thu { --height: 70%; animation-delay: .36s; }
.bar-fri { --height: 63%; animation-delay: .48s; }
.bar-sat { --height: 89%; animation-delay: .6s; }
.bar-sun { --height: 75%; animation-delay: .72s; background: #b1eed0; }
.axis { color: #c2ccc7; margin-top: .25rem; font-size: .58rem; }
@keyframes transfer { 0%, 14% { left: 0; opacity: 0; } 22% { opacity: 1; } 56% { left: 95%; opacity: 1; } 60%, 100% { left: 95%; opacity: 0; } }
@keyframes confirm { 0%, 55%, 100% { opacity: .65; } 63%, 92% { opacity: 1; } }
@keyframes trend { 0%, 12%, 100% { transform: scaleY(.58); } 40%, 84% { transform: scaleY(1); } }
[data-paused] .signal, [data-paused] .mirror-device strong, [data-paused] .bar { animation-play-state: paused; }
@media (max-width: 925px) {
  .layout { grid-template: "signin signin" "sync pulse" / repeat(2, minmax(0, 1fr)); max-width: 44rem; align-items: start; }
  .signin { justify-self: center; width: min(100%, 24rem); }
}
@media (max-width: 530px) {
  .top, .layout { width: calc(100% - 2rem); }
  .top { min-height: 4.2rem; }
  .layout { grid-template: "signin" "sync" "pulse" / minmax(0, 1fr); gap: 1.8rem; padding: 2rem 0 3rem; }
  .signin { width: 100%; }
  .scene { height: 14rem; }
}
@media (prefers-reduced-motion: reduce) {
  .signal, .mirror-device strong, .bar { animation: none; }
  .signal, .motion { display: none; }
}
