.planer-launcher {
  position: fixed;
  z-index: 45;
  inset-inline-end: 16px;
  bottom: calc(76px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px 10px 10px;
  border: 1px solid var(--gold-dim);
  border-radius: 16px;
  background: linear-gradient(
    135deg,
    var(--surface),
    var(--surface-2)
  );
  color: var(--text);
  box-shadow: 0 10px 30px rgba(4, 9, 22, 0.28);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.planer-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(4, 9, 22, 0.4);
}

.planer-launcher span {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.planer-launcher strong {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 1.4px;
  color: var(--gold);
}

.planer-launcher small {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.planer-launcher i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(63, 174, 122, 0.12);
}

.planer-mark {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--gold);
  background: rgba(212, 175, 55, 0.1);
  flex: none;
}

.planer-mark svg {
  width: 28px;
  height: 28px;
}

.planer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 9, 20, 0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.planer-panel {
  width: 100%;
  max-width: 520px;
  min-height: 610px;
  padding: 22px 20px
    calc(20px + env(safe-area-inset-bottom));
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  background:
    radial-gradient(
      500px 260px at 50% 25%,
      rgba(212, 175, 55, 0.12),
      transparent 70%
    ),
    var(--surface);
  box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.3);
  animation: planer-up 0.35s
    cubic-bezier(0.22, 0.8, 0.3, 1);
}

@keyframes planer-up {
  from {
    transform: translateY(30px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.planer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.planer-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.planer-title strong {
  display: block;
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 2px;
  color: var(--gold);
}

.planer-title span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.planer-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 28px;
  line-height: 1;
  padding: 2px 8px;
  cursor: pointer;
}

.planer-orb {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 48px auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.planer-orb-ring {
  position: absolute;
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 50%;
  inset: 16px;
  animation: planer-breathe 3.5s
    ease-in-out infinite;
}

.planer-orb-ring--two {
  inset: 0;
  border-color: rgba(212, 175, 55, 0.11);
  animation-delay: 1.1s;
}

.planer-orb-button {
  position: relative;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.6);
  background:
    radial-gradient(
      circle at 35% 25%,
      #f3d77b,
      var(--gold) 45%,
      var(--gold-dim)
    );
  color: #0f1b33;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow:
    0 0 0 12px rgba(212, 175, 55, 0.08),
    0 16px 38px rgba(212, 175, 55, 0.2);
  transition: transform 0.2s ease;
}

.planer-orb-button:hover {
  transform: scale(1.04);
}

.planer-orb-button .planer-mark {
  background: transparent;
  color: #0f1b33;
  width: 74px;
  height: 74px;
}

.planer-orb-button .planer-mark svg {
  width: 64px;
  height: 64px;
}

.planer-panel--listening .planer-orb-ring {
  border-color: rgba(212, 175, 55, 0.8);
  animation-duration: 1.4s;
}

.planer-panel--listening .planer-orb-button {
  animation: planer-pulse 1.2s
    ease-in-out infinite;
}

.planer-panel--thinking .planer-orb-ring {
  border-style: dashed;
  animation: planer-spin 2s linear infinite;
}

.planer-panel--speaking .planer-orb-button {
  animation: planer-speak 1s
    ease-in-out infinite;
}

.planer-panel--unsupported
  .planer-orb-button {
  filter: saturate(0.45);
  opacity: 0.75;
}

@keyframes planer-breathe {
  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.45;
  }

  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

@keyframes planer-pulse {
  50% {
    box-shadow:
      0 0 0 24px rgba(212, 175, 55, 0.04),
      0 16px 38px rgba(212, 175, 55, 0.28);
  }
}

@keyframes planer-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes planer-speak {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.06);
  }
}

.planer-state {
  text-align: center;
  margin: 0 auto 16px;
  color: var(--muted);
  font-size: 13px;
  min-height: 20px;
}

.planer-heard {
  text-align: center;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  margin: 8px auto;
  max-width: 400px;
}

.planer-answer {
  margin: 16px auto;
  padding: 14px 16px;
  max-width: 430px;
  border: 1px solid var(--gold-dim);
  border-radius: 14px;
  background: rgba(212, 175, 55, 0.08);
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
}

.planer-confirm {
  display: flex;
  gap: 9px;
  max-width: 430px;
  margin: 12px auto;
}

.planer-confirm button {
  flex: 1;
  border-radius: 11px;
  padding: 11px 8px;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: #0f1b33;
  font-weight: 700;
  cursor: pointer;
}

.planer-confirm button + button {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}

.planer-examples {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 420px;
  margin: 28px auto;
}

.planer-examples button {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 11px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.planer-examples button:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.planer-cancel {
  display: block;
  margin: 22px auto 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  padding: 9px 16px;
  cursor: pointer;
}

@media (min-width: 640px) {
  .planer-backdrop {
    align-items: center;
    padding: 20px;
  }

  .planer-panel {
    border-bottom: 1px solid var(--border);
    border-radius: 26px;
    max-height: 90vh;
    overflow-y: auto;
  }
}

@media (max-width: 420px) {
  .planer-launcher {
    inset-inline-end: 12px;
  }

  .planer-launcher small {
    display: none;
  }

  .planer-panel {
    min-height: 590px;
  }

  .planer-orb {
    margin-top: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .planer-panel,
  .planer-orb-ring,
  .planer-orb-button {
    animation: none !important;
    transition: none !important;
  }
}