/* Inherits palette + nav from /style.css. Adds neon-ring focus states
   and a tighter responsive grid for the miniapp. */

:root {
  --neon-violet:  #a78bfa;
  --neon-cyan:    #38bdf8;
  --neon-mint:    #10b981;
  --neon-pink:    #f472b6;
  /* Soft halos used for resting-state glows. */
  --glow-violet:  rgba(167, 139, 250, 0.55);
  --glow-cyan:    rgba(56, 189, 248, 0.45);
}

@keyframes neonPulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px var(--neon-violet),
      0 0 12px 0 var(--glow-violet),
      0 0 22px 4px rgba(167, 139, 250, 0.18),
      inset 0 0 0 1px rgba(167, 139, 250, 0.45),
      inset 0 0 12px rgba(167, 139, 250, 0.12);
  }
  50% {
    box-shadow:
      0 0 0 1px var(--neon-cyan),
      0 0 16px 1px var(--glow-cyan),
      0 0 30px 6px rgba(56, 189, 248, 0.22),
      inset 0 0 0 1px rgba(56, 189, 248, 0.5),
      inset 0 0 18px rgba(56, 189, 248, 0.15);
  }
}

@keyframes neonRotate {
  to { --neon-angle: 360deg; }
}

@property --neon-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

.mini-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 56px) clamp(14px, 4vw, 24px) clamp(48px, 9vw, 96px);
}

.mini-head { text-align: center; margin-bottom: clamp(20px, 4vw, 32px); }
.mini-head h1 {
  font-size: clamp(24px, 5.5vw, 40px);
  letter-spacing: -0.02em; line-height: 1.15;
  margin: 14px 0 14px; font-weight: 700;
}
.mini-head .lead {
  max-width: 580px; margin: 0 auto;
  font-size: clamp(14px, 2.4vw, 16px); color: var(--text-muted);
  padding: 0 4px;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono); font-size: 11.5px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--neon-violet); padding: 5px 14px;
  border: 1px solid rgba(167,139,250,0.3); border-radius: 999px;
  background: rgba(167,139,250,0.05);
}

/* ASK CARD ----------------------------------------------------------------- */
.ask-card {
  position: relative;
  background: var(--bg-card, rgba(18,23,36,0.7));
  border: 1px solid var(--border, rgba(148,163,184,0.14));
  border-radius: 16px;
  padding: clamp(16px, 3vw, 22px);
  backdrop-filter: blur(8px);
  margin-bottom: clamp(20px, 4vw, 28px);
}

/* The textarea is wrapped in a div so we can layer a conic gradient
   ring behind it without disturbing the textarea's own border-radius. */
.input-frame {
  position: relative;
  border-radius: 12px;
  padding: 1.5px;          /* thickness of the neon ring */
  background: linear-gradient(180deg, rgba(167,139,250,0.18), rgba(56,189,248,0.10));
  transition: background 0.3s ease;
}
.input-frame::before {
  content: '';
  position: absolute; inset: -1px;
  border-radius: inherit;
  background: conic-gradient(
    from var(--neon-angle),
    transparent 0%,
    var(--neon-violet) 25%,
    var(--neon-cyan) 50%,
    var(--neon-mint) 65%,
    transparent 80%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
  filter: blur(0.5px);
}
/* Neon ring runs at all times — focus boosts brightness */
.input-frame::before {
  opacity: 0.55;
  animation: neonRotate 8s linear infinite;
}
.input-frame:focus-within::before {
  opacity: 1;
  animation: neonRotate 5s linear infinite;
}

.task-input {
  position: relative; z-index: 1;
  width: 100%;
  background: var(--bg-code, #0f1220);
  border: none;
  border-radius: 10.5px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: clamp(14px, 2.4vw, 15px); line-height: 1.55;
  padding: 14px 16px;
  resize: vertical;
  min-height: 78px;
  outline: none;
  transition: box-shadow 0.3s ease;
}
.task-input::placeholder { color: var(--text-faint, #5d6778); }
.task-input:focus {
  box-shadow:
    inset 0 0 0 1px rgba(167,139,250,0.35),
    inset 0 0 22px rgba(167,139,250,0.10),
    inset 0 0 60px rgba(56,189,248,0.06);
}

.ask-controls {
  display: flex; align-items: stretch;
  margin-top: 14px;
}
.ask-controls .btn-primary { flex: 1; }
.ar-btn {
  padding: 8px 14px; font-size: 13px;
  border-radius: 10px; min-height: 44px;
}
.ar-btn.active {
  border-color: #f87171; color: #f87171;
  box-shadow: 0 0 16px rgba(248, 113, 113, 0.35);
}

.result-tag {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.06em;
  background: rgba(167, 139, 250, 0.16);
  border: 1px solid rgba(167, 139, 250, 0.4);
  color: var(--neon-violet, #a78bfa);
  padding: 1px 6px; border-radius: 999px;
  margin-left: 6px;
}
.is-dynamic { border-left: 3px solid var(--neon-violet, #a78bfa); }
.meta-dyn { color: var(--neon-violet, #a78bfa); }

/* AR SECTION -------------------------------------------------------------- */
.ar-section { margin-bottom: 22px; }
.ar-stage {
  position: relative;
  background: #06080f;
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 0 28px rgba(167, 139, 250, 0.18);
  aspect-ratio: 4 / 3;
}
.ar-video {
  width: 100%; height: 100%;
  object-fit: cover;
  background: #000;
  display: block;
}
.ar-overlay {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.ar-controls {
  position: absolute;
  top: 10px; right: 10px;
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px;
  background: rgba(10, 13, 20, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}
.ar-status {
  font-family: var(--font-mono); font-size: 11px;
  color: rgba(167, 139, 250, 0.9);
}
.ar-detections {
  position: absolute;
  bottom: 10px; left: 10px; right: 10px;
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px 10px;
  background: rgba(10, 13, 20, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  backdrop-filter: blur(8px);
}
.ar-det-pill {
  font-family: var(--font-mono); font-size: 11px;
  background: rgba(167, 139, 250, 0.15);
  border: 1px solid rgba(167, 139, 250, 0.35);
  color: #ddd6fe;
  padding: 3px 8px; border-radius: 999px;
}
.ar-det-pill em {
  color: var(--neon-violet, #a78bfa);
  font-style: normal; margin-left: 4px;
}
.ar-foot {
  margin-top: 10px;
  font-size: 12px; color: var(--text-muted);
  padding: 8px 12px;
  background: rgba(10, 13, 20, 0.4);
  border: 1px dashed rgba(148, 163, 184, 0.18);
  border-radius: 8px;
}
.ar-foot code {
  background: rgba(148,163,184,0.12); padding: 1px 5px; border-radius: 4px;
  font-size: 11px; color: #ddd6fe;
}

@media (max-width: 520px) {
  .ar-stage { aspect-ratio: 3 / 4; }
  .toggle-label { padding: 6px 8px; }
  .primary-actions { flex-direction: column; align-items: stretch; width: 100%; }
  .ar-btn { width: 100%; }
  .ask-controls .btn-primary { width: 100%; }
}

/* PRIMARY BUTTON ----------------------------------------------------------- */
.btn-primary {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 22px;
  min-height: 44px;       /* iOS-friendly touch target */
  border-radius: 12px;
  font-size: 14.5px; font-weight: 600;
  cursor: pointer;
  background: linear-gradient(180deg, #a78bfa, #8b5cf6);
  color: #0a0d14;
  border: 1px solid rgba(167,139,250,0.55);
  font-family: inherit;
  isolation: isolate;
  box-shadow:
    0 0 0 1px rgba(167,139,250,0.45),
    0 0 14px 2px rgba(167,139,250,0.35),
    0 0 28px 6px rgba(167,139,250,0.18),
    inset 0 1px 0 rgba(255,255,255,0.25),
    inset 0 -1px 0 rgba(0,0,0,0.20);
  transition: transform 0.15s ease, box-shadow 0.25s ease, background 0.25s ease;
}
/* Conic-gradient halo behind the button — runs always, brighter on hover. */
.btn-primary::before {
  content: '';
  position: absolute; inset: -2px;
  border-radius: inherit;
  background: conic-gradient(
    from var(--neon-angle),
    var(--neon-violet),
    var(--neon-cyan),
    var(--neon-mint),
    var(--neon-pink),
    var(--neon-violet)
  );
  opacity: 0.30;
  filter: blur(8px);
  transition: opacity 0.3s ease;
  z-index: -1;
  animation: neonRotate 6s linear infinite;
}
.btn-primary:hover:not(:disabled),
.btn-primary:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #b69cfd, #9c75f8);
  box-shadow:
    0 0 0 1px rgba(167,139,250,0.7),
    0 0 22px 4px rgba(167,139,250,0.55),
    0 0 44px 10px rgba(56,189,248,0.28),
    inset 0 1px 0 rgba(255,255,255,0.35),
    inset 0 -1px 0 rgba(0,0,0,0.20);
}
.btn-primary:hover:not(:disabled)::before,
.btn-primary:focus-visible:not(:disabled)::before {
  opacity: 0.70;
  animation: neonRotate 4s linear infinite;
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled {
  opacity: 0.55; cursor: progress;
  animation: neonPulse 2s ease-in-out infinite;
}

.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border-2, rgba(148,163,184,0.22));
  border-radius: 10px; padding: 6px 12px;
  min-height: 36px;
  font-family: inherit; font-size: 13px; cursor: pointer;
  transition: all 0.2s;
}
.btn-ghost:hover {
  border-color: var(--neon-violet); color: var(--neon-violet);
  box-shadow: 0 0 14px rgba(167,139,250,0.25);
}
.btn-sm { padding: 4px 10px; font-size: 12px; min-height: 32px; }

/* EXAMPLE CHIPS ----------------------------------------------------------- */
.examples {
  margin-top: 18px; padding-top: 16px;
  border-top: 1px dashed var(--border, rgba(148,163,184,0.14));
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.examples-label {
  font-size: 11.5px; color: var(--text-faint, #5d6778);
  text-transform: uppercase; letter-spacing: 0.15em; font-weight: 600;
  margin-right: 4px;
}
.ex-chip {
  background: rgba(167,139,250,0.08);
  border: 1px solid rgba(167,139,250,0.25);
  color: var(--neon-violet);
  border-radius: 999px;
  padding: 7px 14px;
  min-height: 32px;
  font-size: 12.5px; cursor: pointer;
  font-family: inherit; transition: all 0.2s;
}
.ex-chip:hover, .ex-chip:focus-visible {
  background: rgba(167,139,250,0.18);
  border-color: var(--neon-violet);
  box-shadow: 0 0 12px rgba(167,139,250,0.35);
  outline: none;
}

/* MINI GALAXY ------------------------------------------------------------- */
.mini-galaxy-frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid rgba(167, 139, 250, 0.25);
  box-shadow:
    0 0 22px rgba(167, 139, 250, 0.12),
    inset 0 0 28px rgba(56, 189, 248, 0.05);
  background: #06080f;
  aspect-ratio: 21 / 9;
}
.mini-galaxy-canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.mini-galaxy-controls {
  position: absolute;
  top: 10px; right: 10px;
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px;
  background: rgba(10, 13, 20, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}
.mini-galaxy-label {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text-faint, #5d6778);
  text-transform: uppercase; letter-spacing: 0.2em;
}
.mode-toggle {
  display: inline-flex;
  background: rgba(15, 18, 32, 0.85);
  border-radius: 999px; padding: 2px;
}
.mode-btn {
  background: transparent; border: none; cursor: pointer;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  padding: 4px 10px; border-radius: 999px;
  transition: all 0.2s;
}
.mode-btn:hover { color: var(--text); }
.mode-btn.active {
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.85), rgba(139, 92, 246, 0.95));
  color: #0a0d14;
  box-shadow:
    0 0 0 1px rgba(167, 139, 250, 0.6),
    0 0 12px rgba(167, 139, 250, 0.45);
}
.mini-galaxy-fullink {
  position: absolute;
  bottom: 10px; right: 12px;
  font-family: var(--font-mono); font-size: 10.5px;
  color: rgba(167, 139, 250, 0.75);
  text-decoration: none;
  padding: 3px 9px;
  background: rgba(10, 13, 20, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
.mini-galaxy-fullink:hover {
  color: var(--neon-violet, #a78bfa);
  border-color: rgba(167, 139, 250, 0.4);
  text-decoration: none;
}

@media (max-width: 520px) {
  .mini-galaxy-frame { aspect-ratio: 5 / 3; }
  .mini-galaxy-fullink { font-size: 10px; padding: 3px 8px; }
}

/* RESULTS ----------------------------------------------------------------- */
.results-section { margin-top: 12px; }
.results-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border, rgba(148,163,184,0.14));
  gap: 8px; flex-wrap: wrap;
}
.results-header h2 {
  font-size: clamp(16px, 3vw, 18px); margin: 0; letter-spacing: -0.01em;
}
.results-meta {
  font-family: var(--font-mono); font-size: clamp(11px, 2vw, 12px); color: var(--text-muted);
}
.results-meta .conf-strong   { color: var(--neon-mint); }
.results-meta .conf-moderate { color: #f59e0b; }
.results-meta .conf-weak,
.results-meta .conf-none     { color: var(--text-faint, #5d6778); }

.results-list { list-style: none; padding: 0; margin: 0; counter-reset: rank; }
.result-item {
  position: relative; counter-increment: rank;
  background: var(--bg-card, rgba(18,23,36,0.7));
  border: 1px solid var(--border, rgba(148,163,184,0.14));
  border-radius: 12px;
  padding: clamp(12px, 2.5vw, 16px) clamp(14px, 3vw, 18px) clamp(12px, 2.5vw, 16px) clamp(46px, 9vw, 56px);
  margin-bottom: 10px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.result-item:hover, .result-item:focus-visible {
  border-color: var(--neon-violet);
  transform: translateX(2px);
  box-shadow: 0 0 24px rgba(167,139,250,0.18);
  outline: none;
}
.result-item::before {
  content: counter(rank);
  position: absolute; top: 14px; left: clamp(10px, 2vw, 14px);
  width: clamp(24px, 5vw, 28px); height: clamp(24px, 5vw, 28px);
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-family: var(--font-mono); font-size: clamp(11px, 2vw, 13px); font-weight: 700;
  background: rgba(167,139,250,0.12); color: var(--neon-violet);
  border: 1px solid rgba(167,139,250,0.3);
  box-shadow: 0 0 8px rgba(167,139,250,0.15);
}
.result-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  margin-bottom: 6px;
}
.result-slug {
  font-family: var(--font-mono); font-size: clamp(13px, 2.5vw, 14.5px); font-weight: 600;
  color: var(--text);
  word-break: break-word;
}
.result-score {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--neon-violet);
  background: rgba(167,139,250,0.08);
  border: 1px solid rgba(167,139,250,0.2);
  padding: 2px 8px; border-radius: 6px;
  white-space: nowrap;
}
.result-desc {
  font-size: clamp(12.5px, 2.4vw, 13.5px); color: var(--text-muted); line-height: 1.55;
  margin: 0 0 8px;
}
.result-why {
  font-family: var(--font-mono); font-size: clamp(10.5px, 2vw, 11.5px);
  color: var(--text-faint, #5d6778);
  word-break: break-word;
}
.no-results {
  padding: 32px; text-align: center;
  color: var(--text-muted); font-size: 14px;
  border: 1px dashed var(--border, rgba(148,163,184,0.14));
  border-radius: 12px;
}

/* SKILL DETAIL ------------------------------------------------------------ */
.skill-detail {
  margin-top: 22px;
  background: var(--bg-card, rgba(18,23,36,0.7));
  border: 1px solid var(--neon-violet);
  border-radius: 14px;
  padding: clamp(16px, 3vw, 22px);
  box-shadow: 0 0 28px rgba(167,139,250,0.15);
}
.skill-detail-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border, rgba(148,163,184,0.14));
  gap: 10px;
}
.skill-detail-header h3 {
  font-family: var(--font-mono); font-size: clamp(14px, 2.8vw, 17px); margin: 0;
  color: var(--text);
  word-break: break-all;
}
.skill-body {
  font-size: clamp(13px, 2.4vw, 14px); line-height: 1.7;
  max-height: 60vh; overflow-y: auto;
  padding-right: 4px;
  /* Slim scrollbar on browsers that support it */
  scrollbar-width: thin;
  scrollbar-color: rgba(167,139,250,0.25) transparent;
}
.skill-body::-webkit-scrollbar { width: 6px; }
.skill-body::-webkit-scrollbar-thumb {
  background: rgba(167,139,250,0.25); border-radius: 3px;
}
.skill-body h1, .skill-body h2 { font-size: clamp(15px, 3vw, 17px); margin: 18px 0 8px; letter-spacing: -0.01em; }
.skill-body h3 { font-size: clamp(13px, 2.6vw, 15px); margin: 14px 0 6px; }
.skill-body p { margin: 0 0 10px; }
.skill-body ul, .skill-body ol { padding-left: 22px; margin: 0 0 10px; }
.skill-body li { margin-bottom: 4px; }
.skill-body code {
  background: rgba(148,163,184,0.12); padding: 2px 6px; border-radius: 4px;
  font-size: 0.92em; color: #ddd6fe;
  word-break: break-word;
}
.skill-body pre {
  background: var(--bg-code, #0f1220);
  border: 1px solid var(--border, rgba(148,163,184,0.14));
  border-radius: 8px; padding: 12px 14px;
  overflow-x: auto;
  font-size: clamp(11.5px, 2.2vw, 12.5px); line-height: 1.6; margin: 8px 0;
}
.skill-body pre code { background: none; padding: 0; color: #a5b4fc; }

/* FOOTER ------------------------------------------------------------------ */
.mini-foot {
  margin-top: 48px; padding: clamp(14px, 3vw, 18px) clamp(16px, 3vw, 22px);
  background: rgba(167,139,250,0.04);
  border: 1px dashed rgba(167,139,250,0.2);
  border-radius: 10px;
  font-size: clamp(12px, 2.4vw, 13px); color: var(--text-muted); line-height: 1.6;
}
.mini-foot p { margin: 0; }
.mini-foot strong { color: var(--text); }

/* RESPONSIVE -------------------------------------------------------------- */

@media (max-width: 900px) {
  .nav { padding: 14px 18px; }
  .nav-links { gap: 14px; font-size: 13px; }
}

@media (max-width: 720px) {
  .ask-controls { flex-direction: column; align-items: stretch; }
  .ask-controls .control-row { justify-content: space-between; }
  .ask-controls .btn-primary { width: 100%; }
  .results-header { flex-direction: column; align-items: flex-start; gap: 4px; }
  .skill-detail-header { flex-wrap: wrap; }
}

@media (max-width: 520px) {
  /* Hide secondary nav links on very narrow viewports — leaves brand + try-it.
     The landing page (/) keeps a fuller nav since users come from there. */
  .nav-links a:not(.current):not(.brand-mobile-keep) { font-size: 12px; }
  .nav-links { gap: 10px; }
  .examples { gap: 6px; }
  .ex-chip { padding: 6px 12px; font-size: 12px; }
  .examples-label { width: 100%; margin-bottom: 4px; }
  .skill-body { max-height: 70vh; }   /* phones — give more vertical room */
}

@media (hover: none) and (pointer: coarse) {
  /* Touch devices: no hover-translate on result items (jitter on scroll). */
  .result-item:hover { transform: none; }
  /* Cancel the resting button glow pulse — battery + look. */
}

@media (prefers-reduced-motion: reduce) {
  .input-frame:focus-within::before,
  .btn-primary:hover::before,
  .btn-primary:focus-visible::before { animation: none; }
  .btn-primary:disabled { animation: none; }
  .result-item:hover { transform: none; transition: none; }
}

/* MEGA AR BUTTON (above textbox) ----------------------------------------- */
.ar-megabtn {
  position: relative;
  display: flex; align-items: center; gap: clamp(10px, 3vw, 16px);
  width: 100%;
  min-height: 64px;
  background: linear-gradient(
    135deg,
    rgba(167, 139, 250, 0.16),
    rgba(56, 189, 248, 0.10) 50%,
    rgba(16, 185, 129, 0.10)
  );
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 16px;
  padding: clamp(12px, 3vw, 18px) clamp(14px, 3vw, 22px);
  margin-bottom: 16px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--text);
  isolation: isolate;
  box-shadow:
    0 0 0 1px rgba(167, 139, 250, 0.15),
    0 0 24px rgba(167, 139, 250, 0.18),
    inset 0 0 28px rgba(56, 189, 248, 0.06);
  transition: transform 0.2s, box-shadow 0.25s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
}
.ar-megabtn::before {
  content: '';
  position: absolute; inset: -1px;
  border-radius: inherit;
  background: conic-gradient(
    from var(--neon-angle),
    var(--neon-violet) 0%,
    var(--neon-cyan) 30%,
    var(--neon-mint) 55%,
    var(--neon-pink) 75%,
    var(--neon-violet) 100%
  );
  opacity: 0.35;
  filter: blur(10px);
  z-index: -1;
  animation: neonRotate 7s linear infinite;
  /* Critical: don't intercept touch on mobile Chrome — the halo isn't
     interactive and shouldn't swallow the click on the underlying button. */
  pointer-events: none;
}
.ar-megabtn-icon, .ar-megabtn-text, .ar-megabtn-arrow { pointer-events: none; }
.ar-megabtn:hover {
  transform: translateY(-1px);
  border-color: var(--neon-violet);
  box-shadow:
    0 0 0 1px rgba(167, 139, 250, 0.35),
    0 0 36px rgba(167, 139, 250, 0.32),
    inset 0 0 32px rgba(56, 189, 248, 0.10);
}
.ar-megabtn:hover::before { opacity: 0.55; animation-duration: 4s; }
.ar-megabtn:active { transform: translateY(0); }
.ar-megabtn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: clamp(40px, 9vw, 48px); height: clamp(40px, 9vw, 48px);
  border-radius: 12px;
  background: rgba(10, 13, 20, 0.65);
  border: 1px solid rgba(167, 139, 250, 0.4);
  font-size: clamp(18px, 4vw, 22px);
  flex-shrink: 0;
}
.ar-megabtn-text {
  display: flex; flex-direction: column; gap: 2px;
  flex: 1 1 auto; min-width: 0;
  overflow: hidden;
}
.ar-megabtn-text strong {
  font-size: clamp(13px, 3.4vw, 16px);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ar-megabtn-text small {
  font-size: clamp(11px, 2.6vw, 12.5px);
  color: var(--text-muted);
  font-weight: 400;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ar-megabtn-arrow {
  font-family: var(--font-mono);
  color: var(--neon-violet);
  font-size: clamp(15px, 3.4vw, 18px);
  flex-shrink: 0;
}
.ar-megabtn.active {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.16), rgba(252, 165, 165, 0.10));
  border-color: rgba(248, 113, 113, 0.5);
  animation: pulseRed 1.6s ease-in-out infinite;
}
@keyframes pulseRed {
  0%, 100% { box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.4), 0 0 24px rgba(248, 113, 113, 0.18); }
  50%      { box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.7), 0 0 40px rgba(248, 113, 113, 0.4);  }
}
.ar-megabtn.active .ar-megabtn-icon { border-color: rgba(248, 113, 113, 0.6); }
.ar-megabtn.active .ar-megabtn-text strong::after {
  content: ' (running — tap to stop)';
  color: rgba(248, 113, 113, 0.85); font-weight: 400; font-size: 12px;
}

/* SIDE PANEL FOR SKILL DETAILS ------------------------------------------- */
.skill-panel {
  position: fixed; inset: 0;
  z-index: 100;
  pointer-events: none;
}
.skill-panel[aria-hidden="false"] { pointer-events: auto; }
.skill-panel-backdrop {
  position: absolute; inset: 0;
  background: rgba(6, 8, 15, 0.6);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.skill-panel[aria-hidden="false"] .skill-panel-backdrop { opacity: 1; }
.skill-panel-body {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(520px, 92vw);
  background: linear-gradient(180deg, #0e1220 0%, #08090f 100%);
  border-left: 1px solid rgba(167, 139, 250, 0.35);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.5), -1px 0 24px rgba(167, 139, 250, 0.18);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.skill-panel[aria-hidden="false"] .skill-panel-body { transform: translateX(0); }
.skill-panel-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border, rgba(148,163,184,0.14));
  flex-shrink: 0;
}
.skill-panel-title-row {
  display: flex; flex-direction: column; gap: 6px;
  flex: 1; min-width: 0;
}
.skill-panel-header h3 {
  font-family: var(--font-mono); font-size: 17px;
  margin: 0;
  color: var(--text);
  word-break: break-word;
}
.skill-panel-class {
  display: inline-flex; align-self: flex-start;
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
}
.skill-panel-class[data-class="planet"]    { background: rgba(56, 189, 248, 0.16);  color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.35); }
.skill-panel-class[data-class="trojan"]    { background: rgba(167, 139, 250, 0.16); color: #c4b5fd; border: 1px solid rgba(167, 139, 250, 0.35); }
.skill-panel-class[data-class="moon"]      { background: rgba(148, 163, 184, 0.16); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.35); }
.skill-panel-class[data-class="asteroid"]  { background: rgba(251, 191, 36, 0.14);  color: #fcd34d; border: 1px solid rgba(251, 191, 36, 0.30); }
.skill-panel-class[data-class="comet"]     { background: rgba(244, 114, 182, 0.14); color: #f9a8d4; border: 1px solid rgba(244, 114, 182, 0.30); }
.skill-panel-class[data-class="irregular"] { background: rgba(192, 132, 252, 0.16); color: #d8b4fe; border: 1px solid rgba(192, 132, 252, 0.35); }
.skill-panel-class[data-class="dynamic"]   { background: rgba(167, 139, 250, 0.18); color: #a78bfa; border: 1px solid rgba(167, 139, 250, 0.45); }

.skill-panel-why {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border, rgba(148,163,184,0.14));
  flex-shrink: 0;
}
.skill-panel-why h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--text-faint, #5d6778);
  margin: 0 0 10px;
  font-weight: 700;
}
.score-breakdown {
  display: grid; grid-template-columns: max-content 1fr max-content;
  gap: 4px 12px; align-items: center;
  font-family: var(--font-mono); font-size: 12px;
}
.score-breakdown .label { color: var(--text-muted); }
.score-breakdown .bar {
  height: 6px;
  background: rgba(148,163,184,0.12);
  border-radius: 999px;
  overflow: hidden;
}
.score-breakdown .bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-violet), var(--neon-cyan));
  border-radius: 999px;
}
.score-breakdown .val { color: var(--text); text-align: right; min-width: 38px; }
.decision-rule {
  margin-top: 14px; padding: 10px 12px;
  background: rgba(167, 139, 250, 0.06);
  border: 1px dashed rgba(167, 139, 250, 0.25);
  border-radius: 8px;
  font-size: 12.5px; color: var(--text-muted);
  line-height: 1.55;
}
.decision-rule strong { color: var(--neon-violet); font-weight: 600; }
.classification-meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 10px;
}
.classification-meta .meta-pill {
  font-family: var(--font-mono); font-size: 10.5px;
  background: rgba(148,163,184,0.10);
  border: 1px solid rgba(148,163,184,0.18);
  color: var(--text-muted);
  padding: 3px 8px; border-radius: 999px;
}
.classification-meta .meta-pill em {
  color: var(--text); font-style: normal; margin-left: 4px;
}
.token-hits { margin-top: 10px; font-family: var(--font-mono); font-size: 11.5px; }
.token-hits .tok {
  display: inline-block;
  background: rgba(167, 139, 250, 0.14);
  color: var(--neon-violet);
  padding: 1px 7px; border-radius: 999px;
  margin: 2px 4px 2px 0;
  border: 1px solid rgba(167, 139, 250, 0.25);
}

.skill-panel-content {
  padding: 16px 22px 24px;
  overflow-y: auto;
  flex: 1;
  font-size: clamp(13px, 2.4vw, 14px);
  line-height: 1.7;
  scrollbar-width: thin;
  scrollbar-color: rgba(167,139,250,0.25) transparent;
}
.skill-panel-content::-webkit-scrollbar { width: 6px; }
.skill-panel-content::-webkit-scrollbar-thumb { background: rgba(167,139,250,0.25); border-radius: 3px; }
.skill-panel-content h1, .skill-panel-content h2 { font-size: 16px; margin: 18px 0 8px; letter-spacing: -0.01em; }
.skill-panel-content h3 { font-size: 14px; margin: 14px 0 6px; }
.skill-panel-content p { margin: 0 0 10px; }
.skill-panel-content ul, .skill-panel-content ol { padding-left: 22px; margin: 0 0 10px; }
.skill-panel-content code {
  background: rgba(148,163,184,0.12); padding: 2px 6px; border-radius: 4px;
  font-size: 0.92em; color: #ddd6fe;
}
.skill-panel-content pre {
  background: var(--bg-code, #0f1220);
  border: 1px solid var(--border, rgba(148,163,184,0.14));
  border-radius: 8px; padding: 12px 14px; overflow-x: auto;
  font-size: 12.5px; line-height: 1.6; margin: 8px 0;
}
.skill-panel-content pre code { background: none; padding: 0; color: #a5b4fc; }

@media (max-width: 600px) {
  .skill-panel-body {
    width: 100vw;
    border-left: none;
    border-top: 1px solid rgba(167, 139, 250, 0.35);
    top: auto; height: 90vh;
    border-top-left-radius: 16px; border-top-right-radius: 16px;
    transform: translateY(100%);
  }
  .skill-panel[aria-hidden="false"] .skill-panel-body { transform: translateY(0); }
}

/* class chip on result row */
.result-class {
  font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600;
  padding: 1px 6px; border-radius: 999px;
  margin-left: 6px;
}
.result-class[data-class="planet"]    { background: rgba(56, 189, 248, 0.12);  color: #7dd3fc; }
.result-class[data-class="trojan"]    { background: rgba(167, 139, 250, 0.14); color: #c4b5fd; }
.result-class[data-class="moon"]      { background: rgba(148, 163, 184, 0.14); color: #cbd5e1; }
.result-class[data-class="asteroid"]  { background: rgba(251, 191, 36, 0.12);  color: #fcd34d; }
.result-class[data-class="comet"]     { background: rgba(244, 114, 182, 0.12); color: #f9a8d4; }
.result-class[data-class="irregular"] { background: rgba(192, 132, 252, 0.14); color: #d8b4fe; }
.result-class[data-class="dynamic"]   { background: rgba(167, 139, 250, 0.16); color: #a78bfa; }

/* Open-domain orbital classifier styles */
.score-breakdown .bar-fill.phys {
  background: linear-gradient(90deg, var(--neon-mint), var(--neon-cyan));
}
.loading-pulse {
  display: inline-block;
  background: linear-gradient(90deg, var(--neon-violet), var(--neon-cyan), var(--neon-mint), var(--neon-violet));
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: loadingShift 2.5s linear infinite;
  font-size: 14px; font-weight: 600;
}
@keyframes loadingShift {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* Result row: star-system chip next to the celestial-class chip */
.result-system {
  font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600;
  padding: 1px 6px; border-radius: 999px;
  margin-left: 4px;
  background: rgba(148, 163, 184, 0.10);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

/* Polished side panel body for LLM-generated skills */
.skill-tagline {
  font-size: 14px; color: var(--text-muted); line-height: 1.55;
  padding: 0 0 14px;
  margin: 0 0 14px;
  border-bottom: 1px dashed var(--border, rgba(148,163,184,0.14));
}
.skill-md h2 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.18em;
  font-weight: 700;
  color: var(--neon-violet);
  margin: 18px 0 8px;
}
.skill-md h3 { font-size: 14px; margin: 14px 0 6px; }
.skill-md p  { margin: 0 0 10px; }
.skill-md ul, .skill-md ol { padding-left: 22px; margin: 0 0 12px; }
.skill-md li { margin-bottom: 4px; }
.skill-md code {
  background: rgba(148,163,184,0.12); padding: 2px 6px; border-radius: 4px;
  font-size: 0.92em; color: #ddd6fe;
}
.skill-md pre {
  background: var(--bg-code, #0f1220);
  border: 1px solid var(--border, rgba(148,163,184,0.14));
  border-radius: 8px; padding: 12px 14px; overflow-x: auto;
  font-size: 12.5px; line-height: 1.6; margin: 8px 0;
}
.skill-md pre code { background: none; padding: 0; color: #a5b4fc; }

.skill-keywords {
  margin-top: 22px; padding-top: 14px;
  border-top: 1px dashed var(--border, rgba(148,163,184,0.14));
  line-height: 2.1;
}
.skill-keywords .kw-label {
  display: block;
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.18em; text-transform: uppercase; font-weight: 600;
  color: var(--text-faint, #5d6778);
  margin-bottom: 6px;
}
.skill-keywords code {
  font-size: 11.5px; padding: 2px 8px; margin-right: 4px;
  background: rgba(167, 139, 250, 0.10);
  color: #c4b5fd;
  border: 1px solid rgba(167, 139, 250, 0.22);
  border-radius: 999px;
}

/* AR rescan button — appears under the camera pane after a route call
   completes. Explicit re-arm only; never auto-fires another query. */
.ar-rescan-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  font-family: var(--font-mono); font-size: 13px;
  font-weight: 600;
  background: rgba(167, 139, 250, 0.10);
  border: 1px dashed rgba(167, 139, 250, 0.5);
  color: var(--neon-violet);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.ar-rescan-btn:hover {
  background: rgba(167, 139, 250, 0.18);
  border-style: solid;
  box-shadow: 0 0 18px rgba(167, 139, 250, 0.25);
}
