/* ============================================================================
   DNA GENIE — floating co-pilot (chief command-center styling, self-contained)
   ========================================================================== */

.genie-orb {
  position: fixed; right: 22px; bottom: 22px; z-index: 998;
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #d4b87a, #C8A96E 55%, #8a6d3b);
  color: #0a0a0e; font-size: 22px; border: 0; cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(200, 169, 110, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.genie-orb:hover { transform: translateY(-2px); }
.genie-orb-badge {
  position: absolute; top: -3px; right: -3px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  display: grid; place-items: center;
  background: #e74c3c; color: #fff; font: 700 10px/1 "Inter", sans-serif;
}

.genie-peek {
  position: fixed; right: 88px; bottom: 30px; z-index: 998;
  max-width: 300px; padding: 12px 14px; border-radius: 12px 12px 4px 12px;
  background: #1a1a24; border: 1px solid rgba(200, 169, 110, 0.35);
  color: rgba(255, 255, 255, 0.85); font: 400 12.5px/1.55 "Inter", sans-serif;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55); cursor: pointer;
}
.genie-peek strong { color: #C8A96E; display: block; margin-bottom: 3px; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }

.genie-panel {
  position: fixed; right: 22px; bottom: 88px; z-index: 999;
  width: min(390px, calc(100vw - 32px));
  max-height: min(640px, calc(100vh - 120px));
  display: none; flex-direction: column;
  background: #111118; border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
  font-family: "Inter", sans-serif; color: rgba(255, 255, 255, 0.85);
}
.genie-panel.open { display: flex; }

.genie-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, #0a0a0e, #1a1a24);
}
.genie-head-title { flex: 1; min-width: 0; }
.genie-head-title strong {
  display: block; font-family: "Playfair Display", serif; font-size: 15px; font-weight: 600; color: #fff;
}
.genie-head-title span { font-size: 10px; color: rgba(255, 255, 255, 0.4); }
.genie-plan {
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 3px; cursor: pointer; border: 0;
}
.genie-plan.foundation { background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.55); }
.genie-plan.assistant { background: rgba(200, 169, 110, 0.2); color: #C8A96E; }
.genie-close { background: none; border: 0; color: rgba(255, 255, 255, 0.4); font-size: 16px; cursor: pointer; padding: 4px; }
.genie-close:hover { color: #fff; }

.genie-nudges { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px 0; }
.genie-nudge {
  font-size: 11px; font-weight: 600; color: #C8A96E;
  background: rgba(200, 169, 110, 0.1); border: 1px solid rgba(200, 169, 110, 0.3);
  border-radius: 999px; padding: 6px 11px; cursor: pointer; transition: background 0.15s;
}
.genie-nudge:hover { background: rgba(200, 169, 110, 0.18); }

.genie-thread { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.genie-msg { max-width: 88%; padding: 10px 13px; border-radius: 12px; font-size: 13px; line-height: 1.55; }
.genie-msg.user { align-self: flex-end; background: rgba(200, 169, 110, 0.16); color: #fff; border-radius: 12px 12px 4px 12px; }
.genie-msg.genie { align-self: flex-start; background: #1a1a24; border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 12px 12px 12px 4px; }
.genie-msg .playbook-tag { display: block; margin-top: 6px; font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.3); }
.genie-speak { display: inline-flex; align-items: center; justify-content: center; margin-top: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); color: rgba(255,255,255,0.55); cursor: pointer; transition: color .15s, border-color .15s; }
.genie-speak:hover { color: #C8A96E; border-color: rgba(200,169,110,0.5); }
.genie-speak.loading { animation: genie-pulse 1s ease-in-out infinite; color: #C8A96E; }
@keyframes genie-pulse { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
.genie-suggestions { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; max-width: 92%; }
.genie-suggestion {
  font-size: 11px; font-weight: 600; color: #0a0a0e;
  background: #C8A96E; border: 0; border-radius: 6px; padding: 7px 12px; cursor: pointer;
}
.genie-suggestion.ghost { background: none; border: 1px solid rgba(255, 255, 255, 0.16); color: rgba(255, 255, 255, 0.7); }
.genie-suggestion:hover { filter: brightness(1.08); }
.genie-typing { align-self: flex-start; color: rgba(255, 255, 255, 0.4); font-size: 12px; padding: 4px 2px; }

.genie-form { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.genie-mic {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 8px;
  border: 1px solid rgba(200, 169, 110, 0.4); background: rgba(200, 169, 110, 0.1);
  color: #C8A96E; cursor: pointer; font-size: 15px;
}
.genie-mic.recording { background: #e74c3c; border-color: #e74c3c; color: #fff; animation: geniePulse 1.4s ease-in-out infinite; }
@keyframes geniePulse { 50% { box-shadow: 0 0 0 6px rgba(231, 76, 60, 0.25); } }
.genie-input {
  flex: 1; min-height: 38px; max-height: 90px; resize: none;
  background: rgba(0, 0, 0, 0.3); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 8px;
  padding: 9px 12px; font: 400 13px/1.4 "Inter", sans-serif;
}
.genie-input:focus { outline: none; border-color: rgba(200, 169, 110, 0.5); }
.genie-send {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 8px; border: 0;
  background: #C8A96E; color: #0a0a0e; font-weight: 700; cursor: pointer; font-size: 15px;
}
.genie-foot { padding: 8px 16px 12px; font-size: 10.5px; color: rgba(255, 255, 255, 0.35); }
.genie-foot button { background: none; border: 0; color: #C8A96E; font: inherit; font-weight: 700; cursor: pointer; padding: 0; }

/* Upgrade view */
.genie-upgrade { padding: 18px 16px; overflow-y: auto; }
.genie-upgrade h3 { font-family: "Playfair Display", serif; font-size: 17px; color: #fff; margin: 0 0 4px; }
.genie-upgrade > p { font-size: 12px; color: rgba(255, 255, 255, 0.55); margin: 0 0 14px; line-height: 1.55; }
.genie-tiers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.genie-tier { border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px; padding: 13px 12px; background: #1a1a24; }
.genie-tier.best { border-color: rgba(200, 169, 110, 0.5); background: linear-gradient(180deg, rgba(200, 169, 110, 0.08), #1a1a24); }
.genie-tier h4 { margin: 0; font-size: 12px; color: #fff; }
.genie-tier .price { font-family: "Playfair Display", serif; font-size: 22px; color: #C8A96E; margin: 4px 0 8px; }
.genie-tier .price small { font-size: 10px; color: rgba(255, 255, 255, 0.4); font-family: "Inter", sans-serif; }
.genie-tier ul { margin: 0 0 10px; padding: 0 0 0 14px; font-size: 10.5px; line-height: 1.6; color: rgba(255, 255, 255, 0.6); }
.genie-tier button {
  width: 100%; border: 0; border-radius: 6px; padding: 8px; font: 700 11px "Inter", sans-serif; cursor: pointer;
}
.genie-tier.best button { background: #C8A96E; color: #0a0a0e; }
.genie-tier:not(.best) button { background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.6); }
.genie-upgrade .fine { font-size: 9.5px; color: rgba(255, 255, 255, 0.3); margin-top: 10px; }

@media (max-width: 560px) {
  .genie-panel {
    position: fixed;
    inset: 0;
    z-index: 9999;
    width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .genie-head { padding-top: max(14px, env(safe-area-inset-top)); }
  .genie-close {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #fff;
    font-size: 28px;
    line-height: 1;
  }
  .genie-form { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .genie-peek { display: none; }
}
