/* ── LM Button ── */
.lm-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--fg);
  text-transform: uppercase;
  opacity: 0.65;
  cursor: none;
  transition: opacity 0.2s;
  padding: 0;
  flex-shrink: 0;
}
.lm-btn:hover { opacity: 1; color: var(--primary); }
.lm-btn svg { width: 12px; height: 12px; fill: var(--primary); flex-shrink: 0; }

/* ── LM Drawer ── */
.lm-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  clip: rect(0, auto, auto, 0);
}
.lm-overlay.open { pointer-events: auto; }

.lm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(50, 64, 79, 0.08);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.lm-overlay.open .lm-backdrop { opacity: 1; }

.lm-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 360px;
  background: var(--bg);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.lm-overlay.open .lm-drawer { transform: translateX(0); }

.lm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 64px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.lm-header-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
}
.lm-header-label svg { width: 12px; height: 12px; fill: var(--primary); }
.lm-close {
  background: none;
  border: none;
  cursor: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg);
  opacity: 0.75;
  transition: opacity 0.2s;
}
.lm-close:hover { opacity: 1; }
.lm-close svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

.lm-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overscroll-behavior: contain;
}

.lm-greeting {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 26px;
  font-weight: 400;
  color: var(--fg);
  line-height: 1.2;
  margin-bottom: 4px;
  margin-top: auto;
}

.lm-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lm-suggestion {
  background: none;
  border: none;
  text-align: left;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--fg-light);
  cursor: none;
  padding: 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.45;
  transition: color 0.15s;
}
.lm-suggestion:hover { color: var(--fg); }
.lm-suggestion::before { content: "↳"; color: var(--fg-muted); flex-shrink: 0; font-size: 12px; margin-top: 1px; }

.lm-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lm-msg {
  max-width: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
}
.lm-msg-user {
  align-self: flex-end;
  background: rgba(50, 64, 79, 0.07);
  border-radius: 12px 12px 2px 12px;
  padding: 10px 14px;
  color: var(--fg);
  max-width: 85%;
}
.lm-msg-ai { color: var(--fg); }
.lm-msg-ai.thinking { color: var(--fg-muted); font-style: italic; }

.lm-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.lm-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(50, 64, 79, 0.05);
  border-radius: 10px;
  padding: 12px 12px;
}
.lm-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--fg);
  resize: none;
  line-height: 1.5;
  max-height: 120px;
  min-height: 20px;
  cursor: text;
}
.lm-input::placeholder { color: var(--fg-muted); }
.lm-mic {
  background: none;
  border: none;
  cursor: none;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-muted);
  opacity: 0.5;
  transition: opacity 0.2s, color 0.2s;
  flex-shrink: 0;
}
.lm-mic:hover { opacity: 1; color: var(--fg); }
.lm-mic.recording { opacity: 1; color: var(--primary); animation: lm-pulse 1s ease-in-out infinite; }
.lm-mic svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
@keyframes lm-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.lm-send {
  background: none;
  border: none;
  cursor: none;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-muted);
  opacity: 0.5;
  transition: opacity 0.2s, color 0.2s;
  flex-shrink: 0;
}
.lm-send:hover, .lm-send.active { opacity: 1; color: var(--primary); }
.lm-send svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── LM Mobile FAB ── */
.lm-fab {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(230, 95, 46, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}
.lm-fab:hover { transform: scale(1.06); box-shadow: 0 6px 20px rgba(230, 95, 46, 0.45); }
.lm-fab svg { width: 22px; height: 22px; fill: white; }

@media (max-width: 768px) {
  .lm-btn { display: none; }
  .lm-fab { display: flex; }
  .lm-drawer {
    width: 100%;
    top: 0;
    height: 100dvh;
    border-left: none;
    border-top: none;
    border-radius: 0;
    transform: translateY(100%);
  }
  .lm-overlay.open .lm-drawer { transform: translateY(0); }
}
