:root {
  color-scheme: dark;
  --bg: #03162e;
  --text: #f7fbff;
  --muted: #9bb1d1;
  --cyan: #49e9ff;
  --blue: #315dff;
  --violet: #9e52ff;
  --rose: #ff6aa8;
  --gold: #ffc98c;
  --safe-top: max(14px, env(safe-area-inset-top));
  --safe-bottom: max(14px, env(safe-area-inset-bottom));
  font-family: Inter, "Avenir Next", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  min-height: 100%;
  overscroll-behavior-x: none;
}

html { background: #010916; }

body {
  margin: 0;
  color: var(--text);
  background: #010916;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button { color: inherit; font: inherit; }
button:focus-visible { outline: 2px solid rgba(92, 230, 255, .95); outline-offset: 4px; }
.is-hidden { display: none !important; }

/* Introduction animée conservée avant l'interface orbitale. */
.intro {
  position: fixed;
  z-index: 100;
  inset: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--safe-top) 28px calc(34px + var(--safe-bottom));
  overflow: hidden;
  color: #f7f5ff;
  background:
    radial-gradient(80% 45% at 50% 34%, rgba(55, 88, 220, .28), transparent 100%),
    radial-gradient(72% 34% at 50% 100%, rgba(47, 156, 136, .18), transparent 100%),
    linear-gradient(180deg, #0e0b1e 0%, #0a0b17 100%);
  transition: opacity .6s ease, visibility .6s ease;
}
.intro.is-leaving { opacity: 0; visibility: hidden; pointer-events: none; }
.intro-video {
  width: min(100%, 430px);
  height: min(53svh, 460px);
  margin-top: clamp(18px, 5svh, 52px);
  flex: 0 1 auto;
  -webkit-mask-image: radial-gradient(closest-side, #000 62%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 62%, transparent 100%);
}
.intro-video video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 55% 50%;
}
.intro-titles {
  margin-top: -24px;
  text-align: center;
  animation: intro-rise 1.2s ease-out 1s both;
}
.intro-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
}
.intro-cube {
  width: 34px;
  height: 37px;
  overflow: visible;
  color: #f4f2ff;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 11px rgba(97, 206, 255, .52));
}
.intro-titles h1 {
  margin: 0;
  font-size: clamp(2.35rem, 11vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -.035em;
  line-height: 1;
}
.intro-titles p {
  margin: 12px 0 0;
  color: #cfc8dc;
  font-size: clamp(.95rem, 4.2vw, 1.12rem);
  font-weight: 560;
}
.intro-actions {
  width: min(100%, 360px);
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: intro-rise 1.2s ease-out 1.3s both;
}
.intro-status {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #cfc8dc;
  font-size: .88rem;
}
.intro-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #809aff;
  box-shadow: 0 0 11px #809aff;
  animation: intro-pulse 1.4s ease-in-out infinite;
}
.intro-connect {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 19px;
  color: #fff;
  background: radial-gradient(120% 160% at 20% 0%, #a3a2f7 0%, #2d4cc8 50%, #1c2b66 100%);
  box-shadow: 0 5px 0 #09080c, 0 14px 30px rgba(46, 77, 200, .45), inset 0 1px 0 rgba(255, 255, 255, .45);
  cursor: pointer;
  font-size: 1.03rem;
  font-weight: 780;
}
.intro-connect:active { transform: translateY(4px); box-shadow: 0 1px 0 #09080c, 0 8px 20px rgba(46, 77, 200, .4); }
.intro-connect:disabled { opacity: .68; cursor: wait; }
.intro-skip {
  border: 0;
  padding: 12px;
  color: #cfc8dc;
  background: none;
  cursor: pointer;
  font-size: .9rem;
  text-decoration: underline;
  text-underline-offset: 4px;
}

@keyframes intro-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes intro-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

.app-shell {
  position: relative;
  width: min(100%, 430px);
  min-height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
  background: #03162e;
  box-shadow: 0 0 90px rgba(14, 64, 160, .18);
}

.orbital-background {
  position: absolute;
  z-index: -3;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 47%;
  opacity: .88;
}

.atmosphere {
  position: absolute;
  z-index: -2;
  inset: 0;
  pointer-events: none;
  background-image: url("./assets/quantum-sphere.png");
  background-repeat: no-repeat;
  background-size: 530px;
  background-position: 50% -430px;
  opacity: .025;
}

.topbar {
  position: relative;
  z-index: 20;
  min-height: 106px;
  padding: var(--safe-top) 16px 7px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 7px 12px;
}

.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand > span:last-child { display: grid; line-height: 1.05; }
.brand strong { font-size: .72rem; letter-spacing: .045em; white-space: nowrap; }
.brand small { margin-top: 3px; color: rgba(205, 221, 255, .62); font-size: .47rem; letter-spacing: .25em; }
.brand-cube {
  width: 19px;
  height: 21px;
  flex: 0 0 auto;
  overflow: visible;
  color: rgba(220, 236, 255, .96);
  fill: none;
  stroke: currentColor;
  stroke-width: 3.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 7px rgba(75, 220, 255, .62));
}

.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.install-button,
.connection-button {
  min-height: 36px;
  border: 1px solid rgba(155, 205, 255, .2);
  border-radius: 999px;
  padding: 0 13px;
  background: rgba(3, 17, 42, .58);
  backdrop-filter: blur(14px);
  cursor: pointer;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .06em;
}
.connection-button { display: flex; align-items: center; gap: 7px; }
.connection-button[data-state="online"] { border-color: rgba(79, 255, 196, .36); }
.connection-button[data-state="busy"] { opacity: .7; cursor: wait; }
.connection-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6f7e9c;
  box-shadow: 0 0 0 rgba(79, 255, 196, 0);
  transition: .25s ease;
}
.connection-button[data-state="online"] .connection-dot { background: #4fffc4; box-shadow: 0 0 12px rgba(79, 255, 196, .9); }

.hero {
  position: relative;
  z-index: 3;
  height: clamp(195px, 27svh, 235px);
  display: grid;
  place-items: center;
  pointer-events: none;
}

.hero-orb {
  border: 0;
  padding: 0;
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
  position: absolute;
  width: clamp(156px, 43vw, 184px);
  aspect-ratio: 1;
  border-radius: 50%;
  --orb-color: var(--hero-color, #2157ff);
  background:
    radial-gradient(circle at 34% 23%, rgba(255,255,255,.98) 0 2.2%, rgba(255,255,255,.7) 2.8%, transparent 10%),
    radial-gradient(circle at 49% 45%, color-mix(in srgb, var(--orb-color) 48%, white) 0 9%, var(--orb-color) 39%, color-mix(in srgb, var(--orb-color) 58%, #02091e) 77%, #010617 100%);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--orb-color) 32%, white),
    inset 0 -15px 24px color-mix(in srgb, var(--orb-color) 42%, white),
    0 0 16px color-mix(in srgb, var(--orb-color) 70%, transparent),
    0 0 42px color-mix(in srgb, var(--orb-color) 44%, transparent);
  overflow: hidden;
  transform: translateY(-2px) scale(1);
  transition: background .45s ease, box-shadow .45s ease, transform .4s cubic-bezier(.2,.8,.2,1);
  animation: hero-breathe 5.8s ease-in-out infinite;
}
.hero-orb:focus-visible { outline: 2px solid #e7f4ff; outline-offset: 6px; }
.hero-orb img {
  width: 100%;
  height: 100%;
  display: block;
  opacity: .5;
  filter: grayscale(1) contrast(1.08) brightness(1.08);
  mix-blend-mode: soft-light;
}
.hero-orb.is-confirming { animation: confirm-hero .55s cubic-bezier(.2,.8,.2,1); }

.hero-copy {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  margin-top: 5px;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 18, .8);
  transition: opacity .16s ease, transform .16s ease;
}
.hero-copy.is-changing { opacity: 0; transform: translateY(var(--copy-shift, 8px)); }
.hero-copy strong { font-size: clamp(1.03rem, 4.9vw, 1.3rem); font-weight: 800; letter-spacing: .025em; text-transform: uppercase; }
.hero-copy span { margin-top: 4px; font-size: .72rem; font-weight: 650; color: rgba(246, 250, 255, .9); }

.selector-stage {
  position: relative;
  z-index: 4;
  height: clamp(416px, calc(57svh - 14px), 500px);
  touch-action: none;
  overscroll-behavior: contain;
  user-select: none;
  outline: none;
  cursor: grab;
}
.selector-stage.is-dragging { cursor: grabbing; }

.frequency-reel {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 142px;
  height: 295px;
  transform: translateY(-50%);
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16%, #000 84%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 16%, #000 84%, transparent 100%);
}
.reel-items { position: absolute; inset: 0; }
.reel-item {
  position: absolute;
  left: 0;
  top: 50%;
  width: 130px;
  display: grid;
  transform: translateY(calc(-50% + var(--reel-y, 0px)));
  opacity: var(--reel-opacity, 0);
  filter: blur(var(--reel-blur, 0));
  transition: transform .34s cubic-bezier(.2,.75,.2,1), opacity .26s ease, filter .26s ease;
}
.reel-item strong { font-size: .69rem; font-weight: 760; letter-spacing: .02em; }
.reel-item small { margin-top: 2px; color: rgba(214, 228, 255, .82); font-size: .53rem; font-weight: 600; letter-spacing: .055em; }
.reel-item:not(.is-active) small { display: none; }
.reel-line {
  position: absolute;
  left: 0;
  right: 12px;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, rgba(74, 236, 255, .06), rgba(74, 236, 255, .95) 38%, rgba(138, 89, 255, .34), transparent);
  box-shadow: 0 0 11px rgba(67, 224, 255, .55);
}

.sphere-track { position: absolute; inset: 0; }
.sphere-button {
  position: absolute;
  left: 0;
  top: 0;
  width: 94px;
  height: 94px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  opacity: var(--sphere-opacity, 0);
  transform: translate(-50%, -50%) scale(var(--sphere-scale, .4));
  transition: left .38s cubic-bezier(.2,.78,.2,1), top .38s cubic-bezier(.2,.78,.2,1), transform .38s cubic-bezier(.2,.78,.2,1), opacity .28s ease;
  will-change: left, top, transform, opacity;
}
.selector-stage.is-dragging .sphere-button,
.selector-stage.is-dragging .reel-item { transition-duration: .08s; }
.orb-visual {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: 50%;
  --orb-color: var(--sphere-color, #2157ff);
  background:
    radial-gradient(circle at 34% 23%, rgba(255,255,255,.98) 0 2.4%, rgba(255,255,255,.72) 3%, transparent 11%),
    radial-gradient(circle at 49% 45%, color-mix(in srgb, var(--orb-color) 48%, white) 0 10%, var(--orb-color) 40%, color-mix(in srgb, var(--orb-color) 58%, #02091e) 78%, #010617 100%);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--orb-color) 32%, white),
    inset 0 -9px 16px color-mix(in srgb, var(--orb-color) 40%, white),
    0 0 10px color-mix(in srgb, var(--orb-color) 72%, transparent),
    0 0 23px color-mix(in srgb, var(--orb-color) 44%, transparent);
  filter: brightness(var(--sphere-dim, 1));
  overflow: hidden;
  transition: background .3s ease, box-shadow .3s ease, filter .3s ease;
  pointer-events: none;
}
.orb-visual img {
  width: 100%;
  height: 100%;
  display: block;
  opacity: .5;
  filter: grayscale(1) contrast(1.08) brightness(1.08);
  mix-blend-mode: soft-light;
  pointer-events: none;
}
.sphere-button::before,
.sphere-button::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 1px solid transparent;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s, transform .25s;
}
.sphere-button.is-preview::before {
  opacity: .8;
  border-top-color: rgba(97, 239, 255, .9);
  border-right-color: rgba(155, 87, 255, .9);
  border-bottom-color: rgba(255, 104, 184, .65);
  transform: rotate(-28deg);
  animation: preview-ring 7s linear infinite;
}
.sphere-button.is-confirmed::before,
.sphere-button.is-confirmed::after { opacity: 1; }
.sphere-button.is-confirmed::before { border-color: rgba(89, 235, 255, .95); box-shadow: 0 0 17px rgba(54, 205, 255, .68); }
.sphere-button.is-confirmed::after { inset: -14px; border-color: rgba(168, 89, 255, .58); box-shadow: 0 0 21px rgba(139, 73, 255, .42); }
.sphere-button.is-pulsing { animation: confirm-pulse .55s cubic-bezier(.2,.8,.2,1); }

.selection-cursor {
  position: absolute;
  left: 72%;
  top: 50%;
  width: 18px;
  height: 18px;
  border: 1px solid color-mix(in srgb, var(--active-program-color, #76edff), white 28%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 14px color-mix(in srgb, var(--active-program-color, #37dfff), transparent 15%), inset 0 0 7px rgba(151, 73, 255, .72);
  pointer-events: none;
}
.selection-cursor span { position: absolute; inset: 5px; border-radius: 50%; background: #fff; box-shadow: 0 0 12px 3px var(--active-program-color, #45dfff); }

.power-selector {
  position: relative;
  z-index: 9;
  grid-column: 1 / -1;
  justify-self: center;
  width: min(276px, 100%);
  min-height: 44px;
  margin: 0;
  padding: 0 2px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  border: 1px solid rgba(146, 208, 255, .16);
  border-radius: 999px;
  background: rgba(2, 17, 44, .48);
  box-shadow: inset 0 0 18px rgba(53, 116, 255, .07), 0 8px 24px rgba(0, 5, 20, .18);
  backdrop-filter: blur(12px);
}
.power-selector button {
  position: relative;
  z-index: 2;
  min-height: 42px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: rgba(218, 230, 255, .7);
  font-size: .67rem;
  font-weight: 720;
  letter-spacing: .04em;
  transition: color .25s, opacity .25s;
}
.power-selector button:disabled { opacity: .64; cursor: not-allowed; }
.power-selector button.is-active { color: #fff; }
.power-indicator {
  position: absolute;
  z-index: 1;
  left: calc(16.666% - 23px);
  top: 5px;
  width: 46px;
  height: 31px;
  border-radius: 18px;
  background: rgba(61, 123, 255, .16);
  border: 1px solid rgba(103, 222, 255, .28);
  box-shadow: 0 0 18px rgba(59, 205, 255, .14), inset 0 0 14px rgba(93, 92, 255, .14);
  transition: left .35s cubic-bezier(.2,.8,.2,1), background .3s, border-color .3s;
}
.power-indicator[data-level="boost"] { left: calc(50% - 23px); background: rgba(153, 72, 255, .18); border-color: rgba(174, 102, 255, .4); }
.power-indicator[data-level="overdrive"] { left: calc(83.333% - 23px); background: rgba(255, 99, 123, .18); border-color: rgba(255, 151, 112, .44); }

.status-message {
  position: relative;
  z-index: 8;
  min-height: 24px;
  margin: 0 42px var(--safe-bottom);
  color: rgba(179, 202, 239, .58);
  text-align: center;
  font-size: .55rem;
  letter-spacing: .045em;
}
.status-message[data-state="confirmed"] { color: rgba(116, 240, 255, .86); }

.info-button {
  position: absolute;
  z-index: 10;
  right: 14px;
  bottom: calc(var(--safe-bottom) + 2px);
  width: 26px;
  height: 26px;
  border: 1px solid rgba(160, 200, 255, .18);
  border-radius: 50%;
  background: rgba(4, 17, 39, .4);
  color: rgba(200, 218, 248, .6);
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: .74rem;
}

.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: calc(72px + var(--safe-bottom));
  width: min(330px, calc(100% - 36px));
  transform: translate(-50%, 22px);
  border: 1px solid rgba(113, 219, 255, .28);
  border-radius: 15px;
  padding: 12px 16px;
  background: rgba(3, 14, 35, .92);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
  color: rgba(239, 248, 255, .94);
  text-align: center;
  font-size: .72rem;
  opacity: 0;
  pointer-events: none;
  transition: .24s ease;
  backdrop-filter: blur(16px);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { border-color: rgba(255, 108, 142, .46); color: #ffc4d1; }

.app-dialog {
  width: min(370px, calc(100% - 32px));
  border: 1px solid rgba(107, 209, 255, .22);
  border-radius: 22px;
  padding: 26px;
  color: var(--text);
  background: #06162f;
  box-shadow: 0 30px 100px rgba(0,0,0,.7);
}
.app-dialog::backdrop { background: rgba(0, 4, 14, .8); backdrop-filter: blur(8px); }
.dialog-kicker { color: var(--cyan); font-size: .58rem; font-weight: 800; letter-spacing: .2em; }
.app-dialog h2 { margin: 7px 0 10px; font-size: 1.25rem; }
.app-dialog p { margin: 0 0 20px; color: #aebfde; font-size: .8rem; line-height: 1.6; }
.app-dialog button { min-height: 42px; width: 100%; border: 1px solid rgba(102, 220, 255, .34); border-radius: 12px; background: rgba(51, 107, 255, .16); cursor: pointer; }

@keyframes hero-breathe { 0%,100% { transform: translateY(-2px) scale(1); } 50% { transform: translateY(-5px) scale(1.018); } }
@keyframes confirm-hero { 0% { transform: scale(1); } 46% { transform: scale(1.07); filter: brightness(1.35); } 100% { transform: scale(1); } }
@keyframes preview-ring { to { transform: rotate(332deg); } }
@keyframes confirm-pulse { 0% { transform: translate(-50%,-50%) scale(var(--sphere-scale)); } 42% { transform: translate(-50%,-50%) scale(calc(var(--sphere-scale) * 1.13)); } 100% { transform: translate(-50%,-50%) scale(var(--sphere-scale)); } }

@media (min-height: 900px) {
  .hero { height: 250px; }
  .selector-stage { height: 520px; }
}

@media (max-height: 760px) {
  .intro { padding-bottom: calc(22px + var(--safe-bottom)); }
  .intro-video { height: min(47svh, 330px); margin-top: 6px; }
  .intro-titles { margin-top: -18px; }
  .intro-titles h1 { font-size: 2.15rem; }
  .intro-titles p { margin-top: 8px; font-size: .9rem; }
  .intro-actions { gap: 8px; }
  .intro-connect { min-height: 52px; }
  .intro-skip { padding: 8px; }
  .topbar { min-height: 94px; padding-top: 8px; }
  .hero { height: 178px; }
  .selector-stage { height: 410px; }
  .hero-orb { width: 145px; }
  .frequency-reel { height: 270px; }
}

@media (max-width: 380px) {
  .topbar { padding-inline: 12px; gap: 7px 8px; }
  .brand { gap: 7px; }
  .brand strong { font-size: .66rem; letter-spacing: .035em; }
  .brand small { font-size: .43rem; letter-spacing: .21em; }
  .brand-cube { width: 17px; height: 19px; }
  .connection-button { padding-inline: 10px; }
  .power-selector { width: 100%; }
}

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

/* Two presentations, one Bluetooth session. Orbital stays the opening view. */
.view-switch {position:relative;z-index:21;display:flex;gap:4px;width:240px;margin:5px auto 12px;padding:4px;border:1px solid #5b7292;border-radius:14px;background:#152941}
.view-switch button {flex:1;min-height:38px;padding:6px 18px;border:0;border-radius:10px;background:transparent;color:#cedbef;font-size:.82rem;font-weight:650;cursor:pointer}
.view-switch button[aria-pressed="true"] {background:#d6e5f5;color:#162c47;box-shadow:0 2px 8px #0002}

.app-shell[data-view="keypad"] {
  position: relative;
  min-height: 100svh;
  padding: 18px 16px 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 8%, rgba(255, 255, 255, 0.9), transparent 26rem),
    linear-gradient(155deg, #edf4fa 0%, #dce8f4 52%, #d3e1ef 100%);
}.app-shell[data-view="keypad"] .ambient {
  position: fixed;
  width: 22rem;
  height: 22rem;
  border-radius: 50%;
  filter: blur(1px);
  pointer-events: none;
}.app-shell[data-view="keypad"] .ambient-one {
  right: -15rem;
  top: 20%;
  background: radial-gradient(circle, rgba(96, 149, 220, 0.18), transparent 69%);
}.app-shell[data-view="keypad"] .ambient-two {
  left: -17rem;
  bottom: -5rem;
  background: radial-gradient(circle, rgba(102, 206, 205, 0.14), transparent 70%);
}.app-shell[data-view="keypad"] .controller {
  position: relative;
  z-index: 1;
  width: min(100%, 690px);
  margin: 0 auto;
}.app-shell[data-view="keypad"] .topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}.app-shell[data-view="keypad"] .brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
}.app-shell[data-view="keypad"] .brand-cube {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(31, 66, 109, 0.15);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: inset 0 1px 0 white, 0 5px 14px rgba(54, 84, 119, 0.08);
}.app-shell[data-view="keypad"] .brand-cube svg {
  width: 22px;
  fill: none;
  stroke: #204369;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}.app-shell[data-view="keypad"] .brand,
.app-shell[data-view="keypad"] .connection-button-copy {
  display: flex;
  flex-direction: column;
}.app-shell[data-view="keypad"] .brand strong {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}.app-shell[data-view="keypad"] .brand small {
  margin-top: 3px;
  color: #66809d;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}.app-shell[data-view="keypad"] .connection-button {
  display: flex;
  min-width: 145px;
  height: 44px;
  align-items: center;
  gap: 8px;
  padding: 0 11px 0 8px;
  border: 1px solid rgba(24, 56, 93, 0.13);
  border-radius: 15px;
  color: #24425f;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 5px 15px rgba(55, 86, 122, 0.09);
  transition: transform 160ms ease, background 160ms ease;
}.app-shell[data-view="keypad"] .connection-button:active {
  transform: translateY(1px);
}.app-shell[data-view="keypad"] .connection-button-icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  color: #5e7590;
  background: #e2eaf2;
}.app-shell[data-view="keypad"] .connection-button-icon svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}.app-shell[data-view="keypad"] .connection-button-copy {
  min-width: 0;
  text-align: left;
}.app-shell[data-view="keypad"] .connection-button-copy strong {
  font-size: 11px;
  line-height: 1.2;
}.app-shell[data-view="keypad"] .connection-button-copy small {
  max-width: 80px;
  overflow: hidden;
  margin-top: 2px;
  color: #72879c;
  font-size: 7px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}.app-shell[data-view="keypad"] .status-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #94a4b4;
  box-shadow: 0 0 0 3px rgba(148, 164, 180, 0.16);
}.app-shell[data-view="keypad"] .connection-button.is-connected {
  border-color: rgba(68, 175, 140, 0.24);
  background: rgba(246, 255, 252, 0.72);
}.app-shell[data-view="keypad"] .connection-button.is-connected .connection-button-icon {
  color: #fff;
  background: linear-gradient(145deg, #50c4a0, #2a9e7d);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 4px 8px rgba(43, 152, 121, 0.18);
}.app-shell[data-view="keypad"] .connection-button.is-connected .status-dot {
  background: #38b88e;
  box-shadow: 0 0 0 3px rgba(56, 184, 142, 0.15);
}.app-shell[data-view="keypad"] .view-switch {
  position: relative;
  display: grid;
  width: min(100%, 280px);
  height: 40px;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin: 0 auto 12px;
  padding: 3px;
  border: 1px solid rgba(42, 72, 108, 0.14);
  border-radius: 14px;
  background: rgba(131, 157, 187, 0.18);
  box-shadow: inset 0 1px 3px rgba(70, 100, 135, 0.11);
}.app-shell[data-view="keypad"] .view-switch button {
  position: relative;
  border: 0;
  border-radius: 10px;
  color: #536b86;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}.app-shell[data-view="keypad"] .view-switch button[aria-pressed="true"] {
  color: #173656;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 3px 10px rgba(58, 86, 122, 0.13), inset 0 1px 0 #fff;
}.app-shell[data-view="keypad"] .keypad-current {
  position: relative;
  display: flex;
  height: 76px;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  margin-bottom: 14px;
  padding: 12px 17px;
  border: 1px solid rgba(15, 38, 80, 0.4);
  border-radius: 20px;
  color: white;
  background:
    radial-gradient(circle at 55% 20%, rgba(60, 118, 213, 0.4), transparent 28%),
    linear-gradient(105deg, #102b51 0%, #173c72 54%, #0c2850 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -12px 24px rgba(3, 19, 43, 0.18),
    0 8px 18px rgba(31, 64, 103, 0.16);
}.app-shell[data-view="keypad"] .keypad-current::after {
  position: absolute;
  top: -45%;
  right: 17%;
  width: 1px;
  height: 190%;
  content: '';
  background: linear-gradient(transparent, rgba(122, 169, 244, 0.85), transparent);
  box-shadow: 8px 0 18px rgba(92, 144, 235, 0.55);
  transform: rotate(16deg);
}.app-shell[data-view="keypad"] .figma-orbit {
  position: absolute;
  right: -17px;
  width: 105px;
  height: 105px;
  border: 1px solid rgba(107, 152, 224, 0.2);
  border-radius: 50%;
  box-shadow: 0 0 0 9px rgba(84, 132, 209, 0.05), 0 0 0 18px rgba(84, 132, 209, 0.035);
}.app-shell[data-view="keypad"] .keypad-current-copy {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  flex-direction: column;
}.app-shell[data-view="keypad"] .keypad-caption,
.app-shell[data-view="keypad"] .flux span {
  color: #afc6e2;
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}.app-shell[data-view="keypad"] #keypadName {
  overflow: hidden;
  margin: 2px 0 1px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}.app-shell[data-view="keypad"] #keypadSubtitle {
  color: #c4d6e9;
  font-size: 9px;
}.app-shell[data-view="keypad"] .flux {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 52px;
  align-items: baseline;
  justify-content: flex-end;
  gap: 5px;
}.app-shell[data-view="keypad"] .flux strong {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px;
  font-weight: 600;
}.app-shell[data-view="keypad"] .keypad-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}.app-shell[data-view="keypad"] .program-key {
  --accent: #69a3ff;
  --accent-rgb: 105, 163, 255;
  position: relative;
  height: 59px;
  overflow: hidden;
  padding: 8px 13px 9px;
  border: 1px solid rgba(102, 145, 192, 0.5);
  border-radius: 18px;
  color: #f8fbff;
  text-align: left;
  background:
    linear-gradient(180deg, rgba(174, 207, 239, 0.38) 0%, transparent 24%),
    linear-gradient(180deg, #41658f 0%, #22486f 45%, #0c2c4c 100%);
  box-shadow:
    inset 0 2px 1px rgba(255, 255, 255, 0.28),
    inset 0 -5px 10px rgba(3, 19, 38, 0.25),
    0 5px 9px rgba(31, 65, 101, 0.19),
    0 1px 2px rgba(22, 45, 72, 0.28);
  transition: transform 150ms ease, box-shadow 180ms ease, border-color 180ms ease;
}.app-shell[data-view="keypad"] .program-key:hover {
  transform: translateY(-1px);
}.app-shell[data-view="keypad"] .program-key:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 2px 5px rgba(4, 20, 39, 0.25),
    inset 0 -2px 8px rgba(255, 255, 255, 0.08),
    0 2px 3px rgba(31, 65, 101, 0.14);
}.app-shell[data-view="keypad"] .program-key.wide {
  grid-column: 1 / -1;
}.app-shell[data-view="keypad"] .key-shine {
  position: absolute;
  top: -21px;
  left: 8%;
  width: 84%;
  height: 33px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  filter: blur(4px);
}.app-shell[data-view="keypad"] .key-copy {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100%;
  flex-direction: column;
  justify-content: center;
}.app-shell[data-view="keypad"] .key-name {
  max-width: calc(100% - 16px);
  overflow: hidden;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  line-height: 1.15;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(3, 17, 37, 0.4);
  white-space: nowrap;
}.app-shell[data-view="keypad"] .key-sub {
  overflow: hidden;
  margin-top: 3px;
  color: #c7d7e8;
  font-size: 8px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}.app-shell[data-view="keypad"] .program-key::after {
  position: absolute;
  z-index: 2;
  right: 10px;
  bottom: 5px;
  left: 10px;
  height: 4px;
  border-radius: 99px;
  background: var(--key-accent);
  box-shadow: 0 0 7px rgba(var(--key-rgb,105,163,255), 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.38);
}.app-shell[data-view="keypad"] .program-key.is-sent {
  border-color: var(--key-accent);
  box-shadow:
    inset 0 2px 1px rgba(255, 255, 255, 0.34),
    inset 0 -6px 12px rgba(3, 19, 38, 0.23),
    0 0 0 3px rgba(var(--key-rgb,105,163,255), 0.2),
    0 7px 15px rgba(25, 57, 91, 0.2);
}.app-shell[data-view="keypad"] .program-key.is-sent .program-key::after {
  height: 5px;
  box-shadow: 0 0 11px rgba(var(--key-rgb,105,163,255), 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}.app-shell[data-view="keypad"] .key-sent {
  position: absolute;
  z-index: 3;
  top: 9px;
  right: 10px;
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 50%;
  color: #11304d;
  background: var(--key-accent);
  box-shadow: 0 2px 6px rgba(4, 20, 40, 0.28);
  font-size: 10px;
  font-weight: 800;
}.app-shell[data-view="keypad"] .keypad-power {
  margin-top: 13px;
}.app-shell[data-view="keypad"] .section-label {
  display: block;
  margin-bottom: 6px;
  color: #7388a0;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
}.app-shell[data-view="keypad"] .power-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}.app-shell[data-view="keypad"] .power-selector button {
  position: relative;
  height: 43px;
  overflow: hidden;
  border: 1px solid rgba(74, 109, 147, 0.26);
  border-radius: 15px;
  color: #42617f;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(195, 213, 231, 0.7));
  box-shadow: inset 0 1px 0 #fff, 0 4px 9px rgba(55, 86, 121, 0.1);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  transition: transform 150ms ease, color 150ms ease, box-shadow 150ms ease;
}.app-shell[data-view="keypad"] .power-selector button::before {
  position: absolute;
  inset: 0;
  content: '';
  background: linear-gradient(180deg, rgba(153, 191, 227, 0.55), transparent 45%);
  opacity: 0;
  transition: opacity 150ms ease;
}.app-shell[data-view="keypad"] .power-selector button span {
  position: relative;
  z-index: 1;
}.app-shell[data-view="keypad"] .power-selector button.is-active {
  border-color: rgba(43, 92, 140, 0.72);
  color: white;
  background: linear-gradient(180deg, #6387ac, #294f74);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -5px 9px rgba(9, 34, 61, 0.25),
    0 5px 11px rgba(33, 70, 105, 0.22);
  text-shadow: 0 1px 2px rgba(10, 32, 55, 0.3);
}.app-shell[data-view="keypad"] .power-selector button.is-active::before {
  opacity: 1;
}.app-shell[data-view="keypad"] .power-selector button:active {
  transform: translateY(2px);
}@media (max-width: 350px) {.app-shell[data-view="keypad"] {
    padding-inline: 12px;
  }.app-shell[data-view="keypad"] .brand-cube {
    width: 33px;
    height: 33px;
  }.app-shell[data-view="keypad"] .brand small {
    letter-spacing: 0.1em;
  }.app-shell[data-view="keypad"] .connection-button {
    min-width: 132px;
    padding-right: 8px;
  }.app-shell[data-view="keypad"] .connection-button-copy small {
    max-width: 67px;
  }.app-shell[data-view="keypad"] .keypad-grid {
    gap: 12px 10px;
  }.app-shell[data-view="keypad"] .program-key {
    padding-inline: 10px;
  }.app-shell[data-view="keypad"] .key-name {
    font-size: 11.5px;
  }.app-shell[data-view="keypad"] .key-sub {
    font-size: 7.5px;
  }
}@media (min-width: 600px) {.app-shell[data-view="keypad"] {
    padding-top: 28px;
  }.app-shell[data-view="keypad"] .controller {
    padding: 22px 24px 25px;
    border: 1px solid rgba(255, 255, 255, 0.68);
    border-radius: 30px;
    background: rgba(234, 242, 249, 0.54);
    box-shadow: 0 25px 60px rgba(43, 76, 111, 0.13), inset 0 1px 0 white;
    backdrop-filter: blur(12px);
  }.app-shell[data-view="keypad"] .keypad-grid {
    column-gap: 16px;
  }
}@media (prefers-reduced-motion: reduce) {.app-shell[data-view="keypad"] *,
.app-shell[data-view="keypad"] *::before,
.app-shell[data-view="keypad"] *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.app-shell[data-view="keypad"]{width:100%;max-width:690px;margin:auto;font-family:Manrope,sans-serif;color:#14243e;box-shadow:none;border:0;border-radius:0}
.app-shell[data-view="keypad"]>.orbital-background,.app-shell[data-view="keypad"]>.atmosphere{display:none}
.app-shell[data-view="keypad"] .topbar{padding:0;min-height:44px;flex-wrap:nowrap}
.app-shell[data-view="keypad"] .brand strong{font-family:'Plus Jakarta Sans',sans-serif;font-size:14px;color:#14243e;letter-spacing:-.02em}
.app-shell[data-view="keypad"] .brand small{font-size:8px;letter-spacing:.18em;color:#66809d}
.app-shell[data-view="keypad"] .brand-cube{width:30px;height:30px;color:#204369;filter:none}
.app-shell[data-view="keypad"] .connection-button{min-width:105px;font-size:11px;letter-spacing:0}
.app-shell[data-view="keypad"] .install-button{display:none}
.app-shell[data-view="keypad"] .view-switch{display:grid;width:min(100%,280px)}
.app-shell[data-view="keypad"] .view-switch button{min-height:0;padding:0;font-size:12px}
.app-shell[data-view="keypad"] .keypad{padding:0}
.app-shell[data-view="keypad"] .keypad-current{min-height:76px}
.app-shell[data-view="keypad"] .keypad-current>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:.15;pointer-events:none}
.app-shell[data-view="keypad"] .keypad-current-copy{display:flex;flex-direction:column;z-index:1;min-width:0}
.app-shell[data-view="keypad"] #keypadName{color:white}
.app-shell[data-view="keypad"] .flux-value{color:#fff;font-size:17px;white-space:nowrap;z-index:1}
.app-shell[data-view="keypad"] .program-key{display:flex;flex-direction:column;justify-content:center;gap:0;min-height:59px;border-left-width:1px}
.app-shell[data-view="keypad"] .program-key::after{content:''}
.app-shell[data-view="keypad"] .program-key.key-wide{grid-column:1/-1}
.app-shell[data-view="keypad"] .program-key .key-name{display:block;font-weight:700}
.app-shell[data-view="keypad"] .program-key .key-sub{display:block}
.app-shell[data-view="keypad"] .program-key.is-sent{background:linear-gradient(180deg,rgba(174,207,239,.38),transparent 24%),linear-gradient(#41658f,#22486f 45%,#0c2c4c);color:white}
.app-shell[data-view="keypad"] .program-key.is-sent .key-name{color:white}
.app-shell[data-view="keypad"] .program-key.is-sent .key-sub{color:#c7d7e8}
.app-shell[data-view="keypad"] .key-sent{display:none}
.app-shell[data-view="keypad"] .program-key.is-sent .key-sent{display:grid;font-size:9px}
.app-shell[data-view="keypad"] .power-selector{width:100%;padding:0;min-height:43px;background:none;border:0;box-shadow:none;backdrop-filter:none}
.app-shell[data-view="keypad"] .power-selector button{min-height:43px}
.app-shell[data-view="keypad"] .power-indicator{display:none}
.app-shell[data-view="keypad"] .status-message{color:#536b86;font-size:9px;margin:10px 32px 0;min-height:15px;letter-spacing:0}
.app-shell[data-view="keypad"] .info-button{width:28px;height:28px;bottom:6px;right:6px;color:#536b86;border-color:#9db2c8}

.app-shell[data-view="keypad"] .program-key[data-key-index="10"]{--key-accent:#7fca67;--key-rgb:127, 202, 103}
.app-shell[data-view="keypad"] .program-key[data-key-index="9"]{--key-accent:#54d6e9;--key-rgb:84, 214, 233}
.app-shell[data-view="keypad"] .program-key[data-key-index="8"]{--key-accent:#9e8cff;--key-rgb:158, 140, 255}
.app-shell[data-view="keypad"] .program-key[data-key-index="7"]{--key-accent:#6fa8f5;--key-rgb:111, 168, 245}
.app-shell[data-view="keypad"] .program-key[data-key-index="6"]{--key-accent:#50cabc;--key-rgb:80, 202, 188}
.app-shell[data-view="keypad"] .program-key[data-key-index="5"]{--key-accent:#a6d965;--key-rgb:166, 217, 101}
.app-shell[data-view="keypad"] .program-key[data-key-index="4"]{--key-accent:#63d19b;--key-rgb:99, 209, 155}
.app-shell[data-view="keypad"] .program-key[data-key-index="3"]{--key-accent:#f0ce56;--key-rgb:240, 206, 86}
.app-shell[data-view="keypad"] .program-key[data-key-index="2"]{--key-accent:#dd8b68;--key-rgb:221, 139, 104}
.app-shell[data-view="keypad"] .program-key[data-key-index="1"]{--key-accent:#ba87dd;--key-rgb:186, 135, 221}
.app-shell[data-view="keypad"] .program-key[data-key-index="0"]{--key-accent:#668df4;--key-rgb:102, 141, 244}.app-shell[data-view="keypad"] .brand{flex-direction:row}
.app-shell[data-view="keypad"] .brand>span{display:flex;flex-direction:column}
.app-shell[data-view="keypad"] .brand small{font-size:0}
.app-shell[data-view="keypad"] .brand small::after{content:'THECUBE8';font-size:8px}
.app-shell[data-view="keypad"] .keypad-power::before{content:'PUISSANCE';display:block;text-align:center;color:#7388a0;font-size:7px;font-weight:700;letter-spacing:.16em;margin-bottom:6px}

/* Orbital: one compact Dock access beside the three power controls. */
.app-shell[data-view="orbital"]>.view-switch{display:none}
.orbital-commands{display:flex;align-items:center;gap:8px;min-width:0}
.orbital-commands[hidden]{display:none}
.orbital-commands .power-selector{flex:1;min-width:0;width:auto}
.open-dock{min-height:44px;padding:0 15px;border:1px solid #7296c47a;border-radius:24px;background:#163459;color:#e2edff;font:700 .78rem Manrope,sans-serif;cursor:pointer}
.open-dock:hover{background:#254c7a}
.open-dock:focus-visible{outline:2px solid #b4d1ff;outline-offset:3px}
@media(max-width:700px){.orbital-commands{width:100%}.open-dock{padding:0 13px}.orbital-commands .power-selector{width:auto;gap:0}.orbital-commands .power-selector button{padding-inline:10px}}
@media(min-width:701px){.orbital-commands{flex:1;max-width:470px}}

.orbital-commands{grid-column:1/-1;justify-self:stretch;width:100%;max-width:none}
.open-dock{position:relative;overflow:hidden;padding-bottom:4px;flex:none;background:#162b49;border-color:#688aaf}
.open-dock::after{content:'';position:absolute;bottom:5px;left:12px;right:12px;height:3px;border-radius:3px;background:#b3d8fa}
/* Pascal: plain Dock label, header actions slightly raised. */
.app-shell[data-view="orbital"] .open-dock::after{display:none}
.app-shell[data-view="orbital"] .open-dock{padding-bottom:0}
.app-shell[data-view="orbital"] .top-actions{transform:translateY(-5px)}
