.humanoid-triad-panel {
  margin-top: 1.5rem;
  border: 1px solid rgba(228, 199, 127, 0.22);
  border-radius: 14px;
  padding: 1rem;
  background: linear-gradient(160deg, rgba(10, 13, 26, 0.66), rgba(16, 20, 33, 0.54));
}

.humanoid-triad-refresh {
  display: flex;
  justify-content: flex-end;
  margin: 0.2rem 0 0.7rem;
}

.humanoid-refresh-btn {
  border: 1px solid rgba(230, 201, 140, 0.38);
  border-radius: 999px;
  background: rgba(230, 201, 140, 0.12);
  color: rgba(248, 240, 226, 0.95);
  padding: 0.34rem 0.76rem;
  font-family: "Source Code Pro", monospace;
  cursor: pointer;
}

.humanoid-refresh-btn:hover {
  background: rgba(230, 201, 140, 0.2);
}

.humanoid-triad-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.humanoid-triad-head h2 {
  margin: 0;
}

.humanoid-triad-grid {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.humanoid-triad-grid.is-pulsing {
  animation: triadGridPulse 650ms ease;
}

.humanoid-card {
  border: 1px solid rgba(227, 196, 124, 0.2);
  border-radius: 12px;
  padding: 0.7rem;
  background: linear-gradient(140deg, rgba(24, 26, 40, 0.62), rgba(14, 18, 30, 0.8));
  color: rgba(248, 237, 220, 0.95);
  cursor: pointer;
}

.humanoid-card:hover {
  transform: translateY(-1px);
  border-color: rgba(238, 209, 145, 0.45);
}

.humanoid-card[data-mode="dialogues"] {
  box-shadow: inset 0 0 0 1px rgba(99, 158, 252, 0.2);
}

.humanoid-card[data-mode="ethos"] {
  box-shadow: inset 0 0 0 1px rgba(170, 131, 238, 0.2);
}

.humanoid-card[data-mode="invitation"] {
  box-shadow: inset 0 0 0 1px rgba(240, 191, 120, 0.2);
}

.humanoid-card h3 {
  margin: 0;
  font-size: 1rem;
}

.humanoid-card p {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  opacity: 0.86;
}

.humanoid-preview {
  margin-top: 0.52rem;
  aspect-ratio: 4 / 3;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid rgba(228, 199, 127, 0.2);
  background: rgba(9, 13, 24, 0.75);
}

.humanoid-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.humanoid-viewer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
}

.humanoid-viewer.is-hidden {
  display: none;
}

.humanoid-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 20, 0.88);
}

.humanoid-panel {
  position: relative;
  z-index: 2;
  width: min(980px, calc(100% - 1.2rem));
  max-height: calc(100vh - 1.2rem);
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(230, 201, 140, 0.26);
  background: linear-gradient(160deg, rgba(11, 15, 30, 0.94), rgba(17, 22, 42, 0.9));
  padding: 0.9rem;
  overflow: hidden;
}

.humanoid-panel.is-transitioning {
  animation: viewerTransition 360ms ease;
}

.humanoid-aura {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
}

.humanoid-panel[data-mode="dialogues"] {
  box-shadow: inset 0 0 0 1px rgba(109, 178, 255, 0.22);
}

.humanoid-panel[data-mode="dialogues"] .humanoid-aura {
  background:
    radial-gradient(circle at 20% 18%, rgba(115, 169, 255, 0.22), transparent 34%),
    radial-gradient(circle at 80% 76%, rgba(93, 142, 240, 0.2), transparent 36%),
    repeating-linear-gradient(120deg, rgba(165, 202, 255, 0.08) 0 2px, transparent 2px 18px);
  animation: voiceResonance 5.8s ease-in-out infinite;
}

.humanoid-panel[data-mode="ethos"] {
  box-shadow: inset 0 0 0 1px rgba(186, 133, 240, 0.22);
}

.humanoid-panel[data-mode="ethos"] .humanoid-aura {
  background:
    radial-gradient(circle at 50% 34%, rgba(188, 140, 255, 0.28), transparent 45%),
    repeating-radial-gradient(circle at 50% 40%, rgba(190, 150, 255, 0.1) 0 1px, transparent 1px 22px);
  animation: conceptBloom 7s ease-in-out infinite;
}

.humanoid-panel[data-mode="invitation"] {
  box-shadow: inset 0 0 0 1px rgba(240, 189, 124, 0.22);
}

.humanoid-panel[data-mode="invitation"] .humanoid-aura {
  background:
    radial-gradient(circle at 50% 84%, rgba(255, 202, 128, 0.24), transparent 42%),
    linear-gradient(180deg, rgba(249, 220, 172, 0.13), transparent 34%),
    linear-gradient(0deg, rgba(255, 203, 140, 0.11), transparent 36%);
  animation: thresholdGlow 6.6s ease-in-out infinite;
}

.humanoid-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
}

.humanoid-head-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.humanoid-mode-line {
  margin: 0 0 0.65rem;
  color: rgba(241, 231, 214, 0.88);
  font-size: 0.82rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.humanoid-close,
.humanoid-branch-button {
  border: 1px solid rgba(230, 201, 140, 0.32);
  border-radius: 999px;
  background: rgba(230, 201, 140, 0.1);
  color: rgba(247, 238, 220, 0.94);
  padding: 0.35rem 0.72rem;
  cursor: pointer;
}

.humanoid-body {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: minmax(200px, 360px) 1fr;
}

.humanoid-image-wrap {
  border: 1px solid rgba(227, 197, 131, 0.25);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(12, 15, 26, 0.85);
  position: relative;
}

.humanoid-halo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: min(32vw, 220px);
  line-height: 1;
  color: rgba(244, 222, 180, 0.18);
  text-shadow: 0 0 28px rgba(244, 222, 180, 0.24);
  pointer-events: none;
}

.humanoid-image-wrap img {
  width: 100%;
  display: block;
  max-height: 420px;
  object-fit: cover;
}

.humanoid-meta p {
  margin: 0.35rem 0;
  color: rgba(244, 236, 223, 0.9);
}

.humanoid-note-excerpt {
  padding: 0.55rem;
  border-radius: 10px;
  border: 1px solid rgba(220, 196, 153, 0.22);
  background: rgba(20, 25, 39, 0.65);
}

.humanoid-note {
  color: rgba(244, 221, 174, 0.94);
  text-decoration: none;
}

.humanoid-note.is-disabled {
  pointer-events: none;
  opacity: 0.6;
}

.humanoid-dialogue-branch {
  margin-top: 0.55rem;
  padding: 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(145, 185, 241, 0.24);
  background: rgba(80, 136, 217, 0.08);
}

.humanoid-dialogue-response {
  margin-top: 0.45rem;
  padding: 0.62rem;
  border-radius: 10px;
  border: 1px solid rgba(154, 196, 255, 0.28);
  background: rgba(56, 102, 173, 0.12);
  color: rgba(236, 246, 255, 0.95);
}

.humanoid-dialogue-tools {
  margin-top: 0.55rem;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.humanoid-dialogue-tools input {
  flex: 1;
  min-width: 180px;
  border: 1px solid rgba(208, 225, 255, 0.3);
  border-radius: 8px;
  background: rgba(12, 16, 29, 0.84);
  color: rgba(242, 248, 255, 0.95);
  padding: 0.44rem 0.56rem;
}

.humanoid-invitation-links {
  margin-top: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.humanoid-invitation-links a {
  border: 1px solid rgba(244, 201, 138, 0.28);
  border-radius: 999px;
  padding: 0.28rem 0.66rem;
  text-decoration: none;
  color: rgba(250, 233, 204, 0.95);
  background: rgba(252, 205, 144, 0.1);
}

@keyframes triadGridPulse {
  0% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.08); transform: scale(1.007); }
  100% { filter: brightness(1); transform: scale(1); }
}

@keyframes viewerTransition {
  from { opacity: 0; transform: translateY(6px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes voiceResonance {
  0%, 100% { opacity: 0.45; transform: translateY(0); }
  50% { opacity: 0.64; transform: translateY(-3px); }
}

@keyframes conceptBloom {
  0%, 100% { opacity: 0.42; transform: scale(1); }
  50% { opacity: 0.66; transform: scale(1.02); }
}

@keyframes thresholdGlow {
  0%, 100% { opacity: 0.46; transform: translateY(0); }
  50% { opacity: 0.68; transform: translateY(-2px); }
}

@media (max-width: 840px) {
  .humanoid-body {
    grid-template-columns: 1fr;
  }
}
