:root {
  color-scheme: dark;
  --bg: #020507;
  --glass: rgba(6, 15, 18, 0.54);
  --glass-strong: rgba(6, 14, 18, 0.82);
  --line: rgba(178, 255, 229, 0.16);
  --text: #ecfff7;
  --muted: rgba(223, 255, 243, 0.58);
  --accent: #6dffc1;
  --accent-soft: rgba(109, 255, 193, 0.18);
  --accent-2: #d8fff1;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  overscroll-behavior: none;
  touch-action: none;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

#app {
  position: fixed;
  inset: 0;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 46%, rgba(26, 72, 59, 0.13), transparent 42%),
    linear-gradient(180deg, #020507, #04090b 62%, #010304);
}

#visual {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.vignette,
.scanlines,
.noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.vignette {
  z-index: 2;
  background:
    radial-gradient(circle at center, transparent 44%, rgba(0, 0, 0, 0.38) 78%, rgba(0, 0, 0, 0.84) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 15%, transparent 75%, rgba(0, 0, 0, 0.38));
}

.scanlines {
  z-index: 3;
  opacity: 0.16;
  mix-blend-mode: screen;
  background: repeating-linear-gradient(
    to bottom,
    rgba(219, 255, 241, 0.07) 0,
    rgba(219, 255, 241, 0.07) 1px,
    transparent 1px,
    transparent 4px
  );
}

.noise {
  z-index: 4;
  opacity: 0.065;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.62'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  animation: none;
}

@keyframes noise-shift {
  0% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(-1.5%, 1%, 0); }
  50% { transform: translate3d(1%, -1.5%, 0); }
  75% { transform: translate3d(1.5%, 1.5%, 0); }
  100% { transform: translate3d(-1%, -1%, 0); }
}

.ui-layer {
  position: absolute;
  z-index: 10;
  transition: opacity 0.32s ease, transform 0.42s cubic-bezier(.2,.8,.2,1), visibility 0.32s ease;
}

.glass {
  background: linear-gradient(180deg, rgba(11, 23, 27, 0.74), rgba(4, 10, 12, 0.56));
  border: 1px solid rgba(191, 255, 232, 0.13);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
  -webkit-backdrop-filter: blur(14px) saturate(132%);
  backdrop-filter: blur(14px) saturate(132%);
}

.topbar {
  top: calc(12px + var(--safe-top));
  left: 14px;
  right: 14px;
  height: 66px;
  border-radius: 22px;
  padding: 0 16px 0 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.mark {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(109, 255, 193, 0.15), rgba(109, 255, 193, 0.02) 57%, transparent 58%);
}

.mark-orbit,
.mark-core {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.mark-orbit {
  width: 27px;
  height: 12px;
  border: 1px solid rgba(109, 255, 193, 0.74);
  box-shadow: 0 0 12px rgba(109, 255, 193, 0.36);
}

.mark-orbit-a { transform: translate(-50%, -50%) rotate(22deg); }
.mark-orbit-b { transform: translate(-50%, -50%) rotate(105deg); }

.mark-core {
  width: 7px;
  height: 7px;
  background: var(--accent-2);
  box-shadow: 0 0 14px var(--accent), 0 0 28px var(--accent);
}

.brand-copy {
  min-width: 0;
}

.brand-copy h1 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1;
  font-weight: 780;
  letter-spacing: 0.17em;
  white-space: nowrap;
}

.brand-copy p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.16em;
  white-space: nowrap;
}

.telemetry {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(226, 255, 244, 0.62);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 11px var(--accent);
  animation: live-pulse 1.5s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.78); }
  50% { opacity: 1; transform: scale(1.08); }
}

.center-hud {
  top: calc(95px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  pointer-events: none;
}

.coordinate {
  color: rgba(226, 255, 245, 0.38);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-shadow: 0 0 12px rgba(109, 255, 193, 0.24);
}

.signal-meter {
  height: 12px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.signal-meter span {
  width: 2px;
  height: 4px;
  border-radius: 9px;
  background: rgba(109, 255, 193, 0.5);
  box-shadow: 0 0 6px rgba(109, 255, 193, 0.32);
  transform-origin: center;
  animation: meter 1.3s ease-in-out infinite;
}

.signal-meter span:nth-child(2) { animation-delay: -0.28s; }
.signal-meter span:nth-child(3) { animation-delay: -0.51s; }
.signal-meter span:nth-child(4) { animation-delay: -0.77s; }
.signal-meter span:nth-child(5) { animation-delay: -0.46s; }
.signal-meter span:nth-child(6) { animation-delay: -0.19s; }
.signal-meter span:nth-child(7) { animation-delay: -0.63s; }

@keyframes meter {
  0%, 100% { transform: scaleY(0.6); opacity: 0.28; }
  50% { transform: scaleY(2.4); opacity: 0.9; }
}

.hint {
  left: 50%;
  bottom: calc(108px + var(--safe-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(229, 255, 246, 0.47);
  font-size: 9px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  pointer-events: none;
}

.hint-icon {
  color: var(--accent);
  filter: drop-shadow(0 0 7px var(--accent));
}

.dock {
  left: 12px;
  right: 12px;
  bottom: calc(12px + var(--safe-bottom));
  height: 78px;
  border-radius: 26px;
  padding: 7px 8px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.14fr 1fr 1fr;
  align-items: center;
}

.dock-button {
  position: relative;
  height: 100%;
  border: 0;
  background: transparent;
  color: rgba(226, 255, 245, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease;
}

.dock-button:active {
  transform: scale(0.92);
}

.dock-button.is-active {
  color: var(--accent);
}

.dock-icon {
  position: relative;
  display: block;
  width: 23px;
  height: 23px;
}

.icon-mode {
  border: 1px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 0 0 0 5px rgba(109, 255, 193, 0.05);
}

.icon-mode::before,
.icon-mode::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.icon-mode::before {
  width: 18px;
  height: 7px;
  transform: translate(-50%, -50%) rotate(27deg);
}

.icon-mode::after {
  width: 7px;
  height: 18px;
  transform: translate(-50%, -50%) rotate(27deg);
}

.icon-audio {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.icon-audio i {
  display: block;
  width: 2px;
  height: 9px;
  border-radius: 4px;
  background: currentColor;
  box-shadow: 0 0 7px currentColor;
}

.icon-audio i:nth-child(2) { height: 18px; }
.icon-audio i:nth-child(3) { height: 12px; }

.icon-gyro {
  border: 1px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px rgba(109, 255, 193, 0.04);
}

.icon-gyro::before,
.icon-gyro::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.icon-gyro::before {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 9px currentColor;
}

.icon-gyro::after {
  width: 13px;
  height: 13px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(18deg);
  opacity: 0.8;
}

.dock-button.is-active .icon-audio i {
  animation: audio-bars 0.55s ease-in-out infinite alternate;
}

.dock-button.is-active .icon-audio i:nth-child(2) { animation-delay: -0.2s; }
.dock-button.is-active .icon-audio i:nth-child(3) { animation-delay: -0.35s; }

.dock-button.is-active .icon-gyro::after {
  animation: gyro-sweep 1.55s linear infinite;
}

@keyframes audio-bars {
  from { transform: scaleY(0.42); }
  to { transform: scaleY(1.12); }
}

@keyframes gyro-sweep {
  from { transform: translate(-50%, -50%) rotate(8deg); }
  to { transform: translate(-50%, -50%) rotate(368deg); }
}

.icon-capture {
  border: 1px solid currentColor;
  border-radius: 6px;
}

.icon-capture::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border: 1px solid currentColor;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.icon-capture::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 2px;
  border: 1px solid currentColor;
  border-bottom: 0;
  border-radius: 2px 2px 0 0;
  left: 4px;
  top: -3px;
}

.icon-settings::before,
.icon-settings::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.icon-settings::before {
  width: 21px;
  height: 21px;
  border: 1px dashed currentColor;
}

.icon-settings::after {
  width: 7px;
  height: 7px;
  border: 1px solid currentColor;
  box-shadow: 0 0 8px currentColor;
}

.dock-main {
  margin: -19px 0 0;
  height: 76px;
}

.pulse-ring,
.pulse-core {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.pulse-ring {
  width: 66px;
  height: 66px;
  border: 1px solid rgba(109, 255, 193, 0.38);
  background: radial-gradient(circle, rgba(109, 255, 193, 0.11), rgba(109, 255, 193, 0.025) 58%, transparent 61%);
  box-shadow:
    0 0 18px rgba(109, 255, 193, 0.24),
    inset 0 0 19px rgba(109, 255, 193, 0.12);
}

.pulse-core {
  width: 29px;
  height: 29px;
  background: radial-gradient(circle at 38% 34%, #ffffff, var(--accent-2) 22%, var(--accent) 52%, rgba(109, 255, 193, 0.2) 100%);
  box-shadow: 0 0 18px var(--accent), 0 0 40px rgba(109, 255, 193, 0.55);
}

.dock-main:active .pulse-ring {
  transform: translate(-50%, -50%) scale(0.82);
}

.minimal-toggle {
  right: 13px;
  top: calc(91px + var(--safe-top));
  width: 36px;
  height: 30px;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 3px;
  padding: 7px;
  opacity: 0.56;
  cursor: pointer;
}

.minimal-toggle span {
  display: block;
  height: 1px;
  background: rgba(224, 255, 244, 0.7);
}
.minimal-toggle span:nth-child(1) { width: 16px; }
.minimal-toggle span:nth-child(2) { width: 11px; }
.minimal-toggle span:nth-child(3) { width: 6px; }

.control-sheet {
  left: 10px;
  right: 10px;
  bottom: calc(10px + var(--safe-bottom));
  max-height: min(670px, calc(100dvh - 26px - var(--safe-top)));
  border-radius: 30px;
  padding: 13px 16px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateY(calc(100% + 30px));
  opacity: 0;
  visibility: hidden;
}

.control-sheet.is-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.sheet-handle {
  width: 42px;
  height: 4px;
  border-radius: 99px;
  margin: 0 auto 15px;
  background: rgba(221, 255, 243, 0.18);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.eyebrow {
  color: var(--accent);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.22em;
}

.sheet-head h2 {
  margin: 5px 0 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 660;
  letter-spacing: -0.025em;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(221, 255, 243, 0.13);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  color: rgba(235, 255, 248, 0.68);
  font-size: 22px;
  cursor: pointer;
}

.section-block {
  margin-top: 22px;
}

.section-label {
  margin-bottom: 10px;
  color: rgba(226, 255, 245, 0.42);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.2em;
}

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

.chip {
  min-height: 49px;
  border: 1px solid rgba(225, 255, 246, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.022);
  color: rgba(233, 255, 248, 0.58);
  font-size: 11px;
  font-weight: 630;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: 0.2s ease;
}

.chip span {
  display: block;
  margin-bottom: 4px;
  color: rgba(225, 255, 245, 0.25);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 7px;
  letter-spacing: 0.1em;
}

.chip.is-active {
  border-color: rgba(109, 255, 193, 0.36);
  color: var(--text);
  background: linear-gradient(180deg, rgba(109, 255, 193, 0.13), rgba(109, 255, 193, 0.035));
  box-shadow: inset 0 0 22px rgba(109, 255, 193, 0.045), 0 0 20px rgba(109, 255, 193, 0.04);
}

.chip.is-active span {
  color: var(--accent);
}

.palette-row {
  display: flex;
  gap: 11px;
}

.palette {
  position: relative;
  width: 46px;
  height: 46px;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.palette i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, var(--c2), var(--c1) 38%, rgba(0,0,0,0.2) 75%);
  box-shadow: inset 0 0 0 5px rgba(0,0,0,0.36), 0 0 14px color-mix(in srgb, var(--c1) 45%, transparent);
}

.palette.is-active {
  border-color: rgba(233, 255, 248, 0.5);
  box-shadow: 0 0 0 2px rgba(109, 255, 193, 0.08);
}

.sliders {
  display: grid;
  gap: 16px;
}

.sliders label {
  display: grid;
  gap: 8px;
}

.sliders label > span {
  display: flex;
  justify-content: space-between;
  color: rgba(227, 255, 246, 0.48);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.18em;
}

.sliders b {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 500;
}

input[type="range"] {
  width: 100%;
  height: 24px;
  margin: 0;
  appearance: none;
  background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(109, 255, 193, 0.55), rgba(109, 255, 193, 0.09));
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(109, 255, 193, 0.55);
}

input[type="range"]::-moz-range-track {
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(109, 255, 193, 0.55), rgba(109, 255, 193, 0.09));
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255,255,255,.52);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(109,255,193,.55);
}

.sheet-actions {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 9px;
  margin-top: 22px;
}

.action-button {
  min-height: 49px;
  border-radius: 15px;
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.16em;
  cursor: pointer;
}

.action-button.secondary {
  border: 1px solid rgba(225, 255, 246, 0.13);
  background: rgba(255, 255, 255, 0.025);
  color: rgba(232, 255, 248, 0.58);
}

.action-button.primary {
  border: 1px solid rgba(224, 255, 245, 0.32);
  background: linear-gradient(135deg, #baffdf, #63f3b4 52%, #48c998);
  color: #03100b;
  box-shadow: 0 10px 28px rgba(72, 211, 156, 0.18), inset 0 1px 0 rgba(255,255,255,.7);
}

.toast {
  left: 50%;
  bottom: calc(102px + var(--safe-bottom));
  transform: translate(-50%, 12px);
  min-width: 180px;
  max-width: calc(100vw - 32px);
  padding: 11px 16px;
  border-radius: 15px;
  color: rgba(236, 255, 249, 0.85);
  font-size: 10px;
  text-align: center;
  letter-spacing: 0.045em;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.toast.is-showing {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.intro {
  left: 50%;
  top: 50%;
  width: min(90vw, 410px);
  padding: 34px 25px 25px;
  border-radius: 32px;
  transform: translate(-50%, -50%);
  text-align: center;
  opacity: 1;
  visibility: visible;
}

.intro.is-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -47%) scale(0.96);
}

.intro-visual {
  position: relative;
  width: 116px;
  height: 116px;
  margin: 0 auto 23px;
}

.intro-orbit,
.intro-core {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.intro-orbit {
  border: 1px solid rgba(109, 255, 193, 0.48);
  box-shadow: 0 0 22px rgba(109, 255, 193, 0.15);
}

.intro-orbit-1 {
  width: 98px;
  height: 34px;
  transform: translate(-50%, -50%) rotate(18deg);
  animation: intro-orbit-a 7s linear infinite;
}

.intro-orbit-2 {
  width: 86px;
  height: 38px;
  transform: translate(-50%, -50%) rotate(102deg);
  animation: intro-orbit-b 6s linear infinite reverse;
}

.intro-orbit-3 {
  width: 62px;
  height: 62px;
  border-style: dashed;
  opacity: 0.62;
  animation: intro-spin 9s linear infinite;
}

.intro-core {
  width: 18px;
  height: 18px;
  background: #e8fff6;
  box-shadow: 0 0 18px var(--accent), 0 0 48px var(--accent);
  animation: intro-core 1.8s ease-in-out infinite;
}

@keyframes intro-orbit-a {
  to { transform: translate(-50%, -50%) rotate(378deg); }
}
@keyframes intro-orbit-b {
  to { transform: translate(-50%, -50%) rotate(462deg); }
}
@keyframes intro-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes intro-core {
  50% { transform: translate(-50%, -50%) scale(1.28); opacity: 0.74; }
}

.intro h2 {
  margin: 10px 0 13px;
  color: var(--text);
  font-size: clamp(28px, 7vw, 34px);
  line-height: 1.17;
  font-weight: 680;
  letter-spacing: -0.045em;
}

.intro p {
  margin: 0;
  color: rgba(229, 255, 246, 0.56);
  font-size: 12px;
  line-height: 1.8;
}

.intro-start {
  width: 100%;
  margin-top: 24px;
}

.intro small {
  display: block;
  margin-top: 13px;
  color: rgba(229, 255, 246, 0.33);
  font-size: 9px;
  line-height: 1.5;
}

body.ui-hidden .topbar,
body.ui-hidden .center-hud,
body.ui-hidden .hint,
body.ui-hidden .dock {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.ui-hidden .minimal-toggle {
  opacity: 0.18;
}

body.sheet-open .dock,
body.sheet-open .hint,
body.sheet-open .center-hud,
body.sheet-open .topbar {
  opacity: 0.18;
  pointer-events: none;
}

@media (min-width: 760px) {
  .topbar {
    left: 24px;
    right: 24px;
    top: calc(22px + var(--safe-top));
  }

  .dock {
    left: 50%;
    right: auto;
    width: 520px;
    transform: translateX(-50%);
    bottom: calc(22px + var(--safe-bottom));
  }

  .hint {
    bottom: calc(124px + var(--safe-bottom));
  }

  .control-sheet {
    left: auto;
    right: 22px;
    bottom: calc(22px + var(--safe-bottom));
    width: 420px;
  }

  .toast {
    bottom: calc(124px + var(--safe-bottom));
  }
}

@media (max-width: 370px) {
  .topbar {
    left: 9px;
    right: 9px;
  }

  .brand-copy h1 {
    font-size: 11px;
  }

  .dock {
    left: 7px;
    right: 7px;
  }

  .dock-button {
    font-size: 6.8px;
    letter-spacing: 0.09em;
  }

  .chip-grid {
    gap: 6px;
  }

  .chip {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   V0.2 — adaptive signal engine / lightweight iPhone polish
   ───────────────────────────────────────────────────────────── */

.scope-frame,
.beam-sweep,
.phase-readout {
  position: absolute;
  pointer-events: none;
  z-index: 5;
}

.scope-frame {
  inset: calc(92px + var(--safe-top)) 20px calc(102px + var(--safe-bottom));
  opacity: 0.38;
}

.scope-frame::before,
.scope-frame::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(68vw, 520px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 13%, transparent);
}

.scope-frame::after {
  width: min(48vw, 350px);
  border-style: dashed;
  opacity: 0.55;
}

.scope-frame i {
  position: absolute;
  width: 18px;
  height: 18px;
  opacity: 0.72;
}

.scope-frame i:nth-child(1) {
  left: 0;
  top: 0;
  border-left: 1px solid var(--accent);
  border-top: 1px solid var(--accent);
}

.scope-frame i:nth-child(2) {
  right: 0;
  top: 0;
  border-right: 1px solid var(--accent);
  border-top: 1px solid var(--accent);
}

.scope-frame i:nth-child(3) {
  right: 0;
  bottom: 0;
  border-right: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
}

.scope-frame i:nth-child(4) {
  left: 0;
  bottom: 0;
  border-left: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
}

.beam-sweep {
  left: 0;
  right: 0;
  top: -14%;
  height: 24%;
  opacity: 0.16;
  background: linear-gradient(
    180deg,
    transparent,
    color-mix(in srgb, var(--accent) 5%, transparent) 58%,
    color-mix(in srgb, var(--accent) 34%, transparent) 67%,
    transparent 70%
  );
  mix-blend-mode: screen;
  transform: translate3d(0, -30%, 0);
  animation: beam-scan 8.5s cubic-bezier(.45, 0, .55, 1) infinite;
  will-change: transform;
}

@keyframes beam-scan {
  0%, 12% { transform: translate3d(0, -55%, 0); opacity: 0; }
  18% { opacity: 0.16; }
  72% { opacity: 0.1; }
  88%, 100% { transform: translate3d(0, 540%, 0); opacity: 0; }
}

.phase-readout {
  left: 22px;
  bottom: calc(111px + var(--safe-bottom));
  display: grid;
  gap: 4px;
  color: color-mix(in srgb, var(--accent) 38%, transparent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 7px;
  letter-spacing: 0.18em;
  text-shadow: 0 0 10px var(--accent-soft);
}

.phase-readout b {
  color: color-mix(in srgb, var(--accent-2) 32%, transparent);
  font-weight: 500;
}

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

.render-chip {
  min-width: 0;
  min-height: 58px;
  padding: 9px 6px 8px;
  border: 1px solid rgba(225, 255, 246, 0.1);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.022);
  color: rgba(233, 255, 248, 0.5);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.render-chip:active {
  transform: scale(0.96);
}

.render-chip b,
.render-chip span {
  display: block;
}

.render-chip b {
  color: rgba(235, 255, 248, 0.7);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.render-chip span {
  margin-top: 6px;
  overflow: hidden;
  color: rgba(229, 255, 246, 0.32);
  font-size: 7px;
  line-height: 1.25;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.render-chip.is-active {
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 12%, transparent), rgba(255, 255, 255, 0.018));
  box-shadow: inset 0 0 18px color-mix(in srgb, var(--accent) 5%, transparent);
}

.render-chip.is-active b {
  color: var(--accent-2);
  text-shadow: 0 0 12px var(--accent-soft);
}

.render-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  color: rgba(226, 255, 245, 0.34);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 7px;
  letter-spacing: 0.14em;
}

.render-status .live-dot {
  width: 5px;
  height: 5px;
  animation-duration: 2.2s;
}

body.render-eco .noise,
body.render-eco .beam-sweep,
body.render-eco .scope-frame::after {
  display: none;
}

body.render-eco .scanlines {
  opacity: 0.07;
}

body.render-quality .scope-frame {
  opacity: 0.48;
}

body.gyro-active .scope-frame::after {
  opacity: 0.78;
}

body.gyro-active .phase-readout {
  color: color-mix(in srgb, var(--accent) 56%, transparent);
}

body.ui-hidden .phase-readout {
  opacity: 0;
  visibility: hidden;
}

body.sheet-open .phase-readout {
  opacity: 0.1;
}

@media (pointer: coarse), (max-width: 759px) {
  .glass {
    background: linear-gradient(180deg, rgba(8, 18, 22, 0.88), rgba(4, 10, 12, 0.79));
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    backdrop-filter: blur(8px) saturate(120%);
  }

  .noise {
    opacity: 0.035;
    background-size: 220px 220px;
  }

  .scanlines {
    opacity: 0.105;
  }

  .beam-sweep {
    opacity: 0.12;
    animation-duration: 10.5s;
  }

  .scope-frame {
    inset: calc(98px + var(--safe-top)) 16px calc(105px + var(--safe-bottom));
  }

  .scope-frame::before {
    width: min(74vw, 440px);
  }

  .scope-frame::after {
    width: min(54vw, 310px);
  }

  .phase-readout {
    left: 18px;
    bottom: calc(105px + var(--safe-bottom));
    opacity: 0.72;
  }

  .control-sheet {
    background: linear-gradient(180deg, rgba(8, 19, 23, 0.98), rgba(3, 8, 10, 0.97));
  }
}

@media (max-height: 700px) {
  .scope-frame {
    inset-block: calc(82px + var(--safe-top)) calc(88px + var(--safe-bottom));
  }

  .phase-readout,
  .hint {
    display: none;
  }

  .control-sheet {
    padding-top: 9px;
  }

  .section-block {
    margin-top: 16px;
  }
}
