/* Monica — landing + chat */

body.ym-monica-active {
  overflow: hidden;
}

body.ym-monica-active .x-monica-wrap {
  display: none !important;
}

#ym-monica {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: #000;
  color: #fff;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  display: none;
  flex-direction: column;
}

#ym-monica.open {
  display: flex;
}

#ym-monica .ym-stars {
  pointer-events: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
}

#ym-monica .ym-star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #fff;
  border-radius: 50%;
  opacity: 0.35;
  animation: ym-twinkle 3s infinite ease-in-out;
}

@keyframes ym-twinkle {
  0%,
  100% {
    opacity: 0.15;
  }
  50% {
    opacity: 0.7;
  }
}

.ym-topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}

.ym-topbar button {
  border: 0;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ym-topbar button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

#ym-back,
.ym-chat-exit {
  min-height: 44px;
  min-width: 44px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  gap: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

#ym-back:hover,
.ym-chat-exit:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.45);
}

.ym-back-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.ym-back-label {
  letter-spacing: 0.02em;
}

.ym-topbar-right {
  display: flex;
  gap: 8px;
}

.ym-main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ── Landing ── */
.ym-landing {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 40px;
  text-align: center;
}

.ym-landing.hidden {
  display: none;
}

.ym-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.ym-logo-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.ym-logo-icon .ym-logo-svg,
.ym-logo-icon svg {
  width: 36px;
  height: 36px;
  display: block;
}

.ym-logo-text {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.ym-ask-bar {
  width: min(680px, 100%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  margin-bottom: 18px;
}

.ym-ask-bar input,
.ym-ask-bar textarea {
  flex: 1;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1rem;
  outline: none;
  min-width: 0;
}

.ym-ask-bar textarea {
  resize: none;
  overflow-y: auto;
  max-height: 200px;
  line-height: 1.4;
  font-family: inherit;
  padding: 4px 0;
}

.ym-ask-bar input::placeholder,
.ym-ask-bar textarea::placeholder {
  color: #6b7280;
}

.ym-ask-icon {
  border: 0;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px;
  font-size: 1rem;
  line-height: 1;
}

.ym-ask-icon:hover {
  color: #fff;
}

.ym-ask-voice {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: #fff;
  color: #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.ym-ask-voice.listening {
  background: #f4212e;
  color: #fff;
  animation: ym-pulse-mic 1s infinite;
}

@keyframes ym-pulse-mic {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

.ym-ask-mode {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #9ca3af;
  font-size: 0.85rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
}

.ym-ask-mode:hover {
  color: #fff;
}

.ym-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.ym-quick-btn {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: #e5e7eb;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ym-quick-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.5);
}

/* ── Chat view ── */
.ym-chat {
  flex: 1;
  display: none;
  flex-direction: column;
  min-height: 0;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

.ym-chat.active {
  display: flex;
}

.ym-chat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 0 16px;
}

.ym-chat-exit {
  flex-shrink: 0;
  cursor: pointer;
}

.ym-growth-pill {
  font-size: 0.72rem;
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 999px;
  padding: 4px 10px;
  letter-spacing: 0.02em;
}

.ym-chat-top-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.ym-chat-top button {
  border: 0;
  background: transparent;
  color: #9ca3af;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
}

.ym-chat-top button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.ym-messages {
  flex: 1;
  overflow: auto;
  padding-bottom: 20px;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}

.ym-msg-user {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.ym-msg-user .ym-bubble {
  background: #1a1a1a;
  border: 1px solid #2f3336;
  border-radius: 20px;
  padding: 10px 16px;
  max-width: 75%;
  font-size: 0.98rem;
  line-height: 1.45;
}

.ym-msg-assistant {
  margin-bottom: 16px;
}

.ym-msg-assistant .ym-text {
  font-size: 1.05rem;
  line-height: 1.55;
  color: #f3f4f6;
  white-space: pre-wrap;
  word-break: break-word;
}

.ym-msg-actions {
  display: flex;
  gap: 4px;
  margin-top: 10px;
}

.ym-msg-actions button {
  border: 0;
  background: transparent;
  color: #6b7280;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}

.ym-msg-actions button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.ym-suggestions {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ym-suggest-btn {
  border: 0;
  background: transparent;
  color: #9ca3af;
  text-align: left;
  cursor: pointer;
  padding: 6px 0;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ym-suggest-btn:hover {
  color: #fff;
}

.ym-suggest-btn::before {
  content: "↪";
  color: #6b7280;
}

.ym-chat-bottom {
  padding: 16px 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-shrink: 0;
}

.ym-think-btn {
  border: 1px solid #2f3336;
  background: #111;
  color: #e5e7eb;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ym-think-btn.on {
  border-color: #7856ff;
  background: rgba(120, 86, 255, 0.15);
}

.ym-think-btn:hover {
  background: #1a1a1a;
}

.ym-close-chat {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #2f3336;
  background: #111;
  color: #9ca3af;
  cursor: pointer;
  font-size: 1rem;
}

.ym-close-chat:hover {
  color: #fff;
}

.ym-chat-input-wrap {
  padding: 0 0 20px;
  flex-shrink: 0;
}

.ym-chat-input-wrap .ym-ask-bar {
  margin: 0;
}

.ym-typing {
  color: #6b7280;
  font-size: 0.92rem;
  padding: 8px 0;
  animation: ym-blink 1.2s infinite;
}

@keyframes ym-blink {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}

/* History drawer */
.ym-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9100;
  display: none;
}

.ym-drawer-backdrop.open {
  display: block;
}

.ym-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(320px, 88vw);
  background: #0a0a0a;
  border-right: 1px solid #2f3336;
  z-index: 9200;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}

.ym-drawer.open {
  transform: translateX(0);
}

.ym-drawer-head {
  padding: 18px 16px;
  border-bottom: 1px solid #2f3336;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ym-drawer-head h3 {
  margin: 0;
  font-size: 1rem;
}

.ym-drawer-list {
  flex: 1;
  overflow: auto;
  padding: 8px;
}

.ym-session-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #e5e7eb;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 4px;
}

.ym-session-btn:hover,
.ym-session-btn.active {
  background: rgba(255, 255, 255, 0.06);
}

.ym-session-btn small {
  display: block;
  color: #6b7280;
  font-size: 0.75rem;
  margin-top: 4px;
}

.ym-new-chat {
  margin: 12px;
  padding: 12px;
  border: 1px solid #2f3336;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

.ym-new-chat:hover {
  background: rgba(255, 255, 255, 0.06);
}

.ym-private.on {
  color: #7856ff;
}

.ym-song-card {
  margin-top: 12px;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(120, 86, 255, 0.18), rgba(236, 72, 153, 0.12));
  border: 1px solid rgba(167, 139, 250, 0.25);
}

.ym-song-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.ym-song-lead,
.ym-text.ym-song-lead {
  color: #c4b5fd;
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.ym-song-meta {
  font-size: 0.78rem;
  color: #a78bfa;
  margin-bottom: 10px;
}

.ym-song-audio {
  width: 100%;
  margin-bottom: 8px;
}

.ym-song-lyrics summary {
  cursor: pointer;
  color: #c4b5fd;
  font-size: 0.85rem;
}

.ym-song-lyrics pre {
  white-space: pre-wrap;
  margin-top: 8px;
  font-family: inherit;
  font-size: 0.82rem;
  color: #d1d5db;
}

.ym-image-card,
.ym-video-card,
.ym-news-card {
  margin-top: 12px;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(120, 86, 255, 0.1));
  border: 1px solid rgba(147, 197, 253, 0.22);
}

.ym-image-title,
.ym-video-title,
.ym-news-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.ym-image-meta,
.ym-video-meta,
.ym-news-meta {
  font-size: 0.78rem;
  color: #93c5fd;
  margin-bottom: 10px;
}

.ym-video-link {
  display: block;
}

.ym-video-player,
.ym-video-preview {
  width: 100%;
  max-height: 380px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.55);
  display: block;
}

.ym-video-prompt summary {
  cursor: pointer;
  color: #93c5fd;
  font-size: 0.85rem;
  margin-top: 8px;
}

.ym-video-prompt pre {
  white-space: pre-wrap;
  margin-top: 8px;
  font-family: inherit;
  font-size: 0.82rem;
  color: #d1d5db;
}

.ym-image-link {
  display: block;
}

.ym-image-preview {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.55);
}

.ym-image-prompt summary,
.ym-news-list {
  margin-top: 8px;
}

.ym-image-prompt summary {
  cursor: pointer;
  color: #93c5fd;
  font-size: 0.85rem;
}

.ym-image-prompt pre {
  white-space: pre-wrap;
  margin-top: 8px;
  font-family: inherit;
  font-size: 0.82rem;
  color: #d1d5db;
}

.ym-news-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.ym-news-list li {
  font-size: 0.84rem;
  color: #e5e7eb;
  line-height: 1.45;
}

.ym-news-source {
  display: inline-block;
  min-width: 5.5rem;
  color: #93c5fd;
  font-size: 0.75rem;
  margin-right: 6px;
}

.ym-news-list a {
  color: #f8fafc;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ym-code-card {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.ym-code-title {
  font-weight: 600;
  color: #e0f2fe;
  margin-bottom: 4px;
}

.ym-code-meta {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-bottom: 8px;
}

.ym-code-steps summary {
  cursor: pointer;
  color: #7dd3fc;
  font-size: 0.82rem;
}

.ym-code-steps ul {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 0.8rem;
  color: #cbd5e1;
}

.ym-code-steps li.err {
  color: #fca5a5;
}

.ym-code-patches li.patch {
  color: #86efac;
}

.ym-ask-mode.on {
  border-color: rgba(56, 189, 248, 0.55);
  color: #7dd3fc;
}

@media (max-width: 640px) {
  .ym-logo-text {
    font-size: 1.6rem;
  }

  .ym-quick-actions {
    gap: 8px;
  }

  .ym-quick-btn {
    padding: 8px 12px;
    font-size: 0.82rem;
  }
}

/* Monica compose assist inside share modal */
.ym-share-monica-btn.active {
  color: #a78bfa !important;
  background: rgba(167, 139, 250, 0.15) !important;
}

.ym-compose-assist {
  border-top: 1px solid #2f3336;
  background: #0a0a0a;
  padding: 12px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
}

.ym-compose-assist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ym-compose-assist-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #e7e9ea;
}

.ym-compose-assist-close {
  border: 0;
  background: transparent;
  color: #71767b;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 8px;
}

.ym-compose-assist-close:hover {
  color: #e7e9ea;
  background: rgba(255, 255, 255, 0.06);
}

.ym-compose-msgs {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 140px;
  min-height: 48px;
}

.ym-compose-hint {
  margin: 0;
  font-size: 0.82rem;
  color: #71767b;
  line-height: 1.45;
}

.ym-compose-msg {
  font-size: 0.84rem;
  line-height: 1.45;
  border-radius: 10px;
  padding: 8px 10px;
}

.ym-compose-user {
  align-self: flex-end;
  max-width: 92%;
  background: #1d4ed8;
  color: #fff;
}

.ym-compose-ai {
  align-self: flex-start;
  max-width: 100%;
  background: #16181c;
  border: 1px solid #2f3336;
  color: #e7e9ea;
}

.ym-compose-ai-text {
  white-space: pre-wrap;
}

.ym-compose-insert {
  margin-top: 8px;
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  background: #7856ff;
  color: #fff;
}

.ym-compose-insert:hover {
  background: #9070ff;
}

.ym-compose-typing {
  font-size: 0.82rem;
  color: #71767b;
  font-style: italic;
}

.ym-compose-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ym-compose-quick button {
  border: 1px solid #2f3336;
  background: transparent;
  color: #e7e9ea;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.76rem;
  cursor: pointer;
}

.ym-compose-quick button:hover {
  border-color: #7856ff;
  color: #c4b5fd;
}

.ym-compose-assist-form {
  display: flex;
  gap: 8px;
}

.ym-compose-assist-input {
  flex: 1;
  border: 1px solid #2f3336;
  background: #000;
  color: #e7e9ea;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.86rem;
}

.ym-compose-assist-send {
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  background: #e7e9ea;
  color: #000;
}

.ym-compose-assist-send:hover {
  background: #fff;
}
