/* llm-fallbacks — ResearchWizard shell + murm-ui embed (dark chat chrome) */

/* ── Page shell ─────────────────────────────────────────────── */
html.lf-chat-page,
html.lf-chat-page body {
  height: 100%;
  overflow: hidden;
}

body.lf-chat-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: 44px;
  padding-bottom: 0;
}

body.lf-chat-page::before {
  opacity: 0.12;
}

.main-chat-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 1rem 1rem;
  box-sizing: border-box;
}

#chatMount {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  background: #12121f;
  border: 1px solid rgba(157, 78, 221, 0.22);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

/* Force dark murm-ui inside embed (ignore OS light preference) */
#chatMount.mur-app[data-theme="dark"],
#chatMount.mur-app {
  --mur-bg: #12121f;
  --mur-surface: #1a1a2e;
  --mur-surface-user: #252545;
  --mur-hover-bg: rgba(157, 78, 221, 0.12);
  --mur-text: #e8e8ef;
  --mur-text-secondary: #c4c4d4;
  --mur-text-muted: #8b8ba3;
  --mur-inverse-text: #12121f;
  --mur-border: rgba(157, 78, 221, 0.2);
  --mur-primary: #c77dff;
  --mur-danger: #f87171;
  --mur-danger-text: #fecaca;
  --mur-danger-bg: rgba(127, 29, 29, 0.32);
  --mur-danger-border: rgba(248, 113, 113, 0.38);
  --mur-danger-hover-bg: rgba(248, 113, 113, 0.14);
  --mur-success: #34d399;
  --mur-header-button-bg: rgba(26, 26, 46, 0.88);
  --mur-header-title-bg: rgba(26, 26, 46, 0.72);
  --mur-code-heading-bg: rgba(157, 78, 221, 0.14);
  --mur-overlay-bg: rgba(0, 0, 0, 0.62);
  --mur-attachment-drag-ring: rgba(199, 125, 255, 0.25);
  --mur-shadow-popover: 0 12px 30px rgba(0, 0, 0, 0.4);
  --mur-shadow-button: 0 1px 2px rgba(0, 0, 0, 0.3);
  --mur-shadow-input: 0 4px 18px rgba(0, 0, 0, 0.35);
  --mur-shadow-input-focus: 0 4px 22px rgba(157, 78, 221, 0.28);
  --mur-shadow-sidebar: 4px 0 18px rgba(0, 0, 0, 0.35);
  --mur-shadow-modal: 0 10px 28px rgba(0, 0, 0, 0.45);
  --mur-shadow-attachment: 0 2px 6px rgba(0, 0, 0, 0.35);
  --mur-font: "Poppins", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
  background-color: var(--mur-bg);
  color: var(--mur-text);
}

#chatMount .mur-app.mur-app-embedded {
  flex: 1;
  min-height: 0;
  height: 100%;
  width: 100%;
}

#chatMount .mur-sidebar {
  background: linear-gradient(180deg, #1a1a2e 0%, #151525 100%);
  border-right: 1px solid rgba(157, 78, 221, 0.18);
}

#chatMount .mur-sidebar-logo span:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  background: linear-gradient(135deg, #9d4edd, #5a189a);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

#chatMount .mur-new-chat-btn.mur-sidebar-nav-btn {
  background: rgba(157, 78, 221, 0.18);
  border: 1px solid rgba(157, 78, 221, 0.35);
  color: #e4c7ff;
}

#chatMount .mur-new-chat-btn.mur-sidebar-nav-btn:hover {
  background: rgba(157, 78, 221, 0.28);
}

#chatMount.mur-app-embedded .mur-main-header {
  display: none;
}

@media (max-width: 768px) {
  /* Embedded shell hides the header globally — restore mobile sidebar toggle only */
  #chatMount.mur-app-embedded .mur-main-header {
    display: flex;
    height: var(--mur-header-height, 3rem);
    pointer-events: none;
  }

  #chatMount.mur-app-embedded .mur-open-sidebar-btn {
    display: inline-flex !important;
    pointer-events: auto;
  }
}

#chatMount.mur-app-embedded .mur-chat-history {
  padding-top: 1.5rem;
}

@media (max-width: 768px) {
  #chatMount.mur-app-embedded .mur-chat-history {
    padding-top: 3.5rem;
  }
}

/* Empty state: anchor input to bottom + welcome hero */
#chatMount.mur-app-embedded.mur-chat-empty .mur-chat-form-container {
  bottom: 1.25rem;
  transform: none;
}

#chatMount.mur-app-embedded.mur-chat-empty .mur-chat-layout-wrapper::before {
  content: "Ranked free models, zero config";
  display: block;
  position: absolute;
  top: 36%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 600;
  color: #e8e8ef;
  letter-spacing: -0.02em;
  pointer-events: none;
  z-index: 1;
  text-shadow: 0 0 40px rgba(157, 78, 221, 0.25);
}

#chatMount.mur-app-embedded.mur-chat-empty .mur-chat-layout-wrapper::after {
  content: "Daily-updated catalog via edge proxy. Pick a model above or send a message. Optional BYOK for direct routes.";
  display: block;
  position: absolute;
  top: 44%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(32rem, 88%);
  text-align: center;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #8b8ba3;
  pointer-events: none;
  z-index: 1;
}

#chatMount.mur-app-embedded.mur-chat-empty .mur-chat-scroll-area {
  background:
    radial-gradient(ellipse 55% 45% at 50% 38%, rgba(157, 78, 221, 0.1), transparent 70%);
}

/* Collapsed sidebar rail — icon only, no stray chrome */
@media (min-width: 769px) {
  #chatMount.mur-app-embedded.mur-sidebar-closed .mur-sidebar {
    background: transparent;
    border-right: none;
    box-shadow: none;
    align-items: center;
    padding-top: 0.65rem;
  }

  #chatMount.mur-app-embedded.mur-sidebar-closed .mur-sidebar-header {
    justify-content: center;
    width: 100%;
    padding-inline: 0.25rem;
  }

  #chatMount.mur-app-embedded.mur-sidebar-closed .mur-sidebar-actions {
    display: none;
  }

  #chatMount.mur-app-embedded.mur-sidebar-closed .mur-sidebar-logo span:last-child {
    display: none;
  }
}

#chatMount .mur-message-assistant .mur-message-blocks-wrapper {
  background: rgba(26, 26, 46, 0.65);
  border: 1px solid rgba(157, 78, 221, 0.12);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
}

#chatMount .mur-message.mur-message-assistant {
  width: auto;
  max-width: min(88%, 36rem);
}

#chatMount .mur-message.mur-message-user {
  max-width: min(78%, 28rem);
}

#chatMount .mur-message-user .mur-message-blocks-wrapper {
  border-radius: 12px;
}

#chatMount .mur-send-btn.mur-action-btn.mur-form-icon-btn {
  background: linear-gradient(135deg, #9d4edd, #7b2cbf);
  color: #fff;
  border: none;
}

#chatMount .mur-send-btn.mur-action-btn.mur-form-icon-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #b76fe8, #9d4edd);
  color: #fff;
}

#chatMount .mur-send-btn.mur-action-btn:disabled {
  background: rgba(157, 78, 221, 0.2);
  color: var(--mur-text-muted);
}

#chatMount .mur-chat-form-container {
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(18, 18, 31, 0.85) 1.25rem,
    rgba(18, 18, 31, 0.98) 100%
  );
}

#chatMount .mur-chat-form {
  background: #1e1e32;
  border-color: rgba(157, 78, 221, 0.28);
}

#chatMount .mur-chat-form:focus-within {
  border-color: rgba(199, 125, 255, 0.55);
}

#chatMount .mur-send-btn.mur-action-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #b76fe8, #9d4edd);
  color: #fff;
}

#chatMount .mur-message-user .mur-message-blocks-wrapper {
  background: var(--mur-surface-user);
  border: 1px solid rgba(157, 78, 221, 0.15);
}

/* ── Top bar ────────────────────────────────────────────────── */
.credits-bar.top-credits {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(157, 78, 221, 0.28);
}

.credits-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.credits-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.credits-bar p {
  color: #d8d8e8;
  flex: 1 1 12rem;
  text-align: left;
  min-width: 0;
}

.credits-bar p strong {
  color: #c77dff;
}

.credits-actions .top-settings-button {
  margin-left: 0;
}

.top-settings-button {
  cursor: pointer;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(157, 78, 221, 0.3);
  background: rgba(157, 78, 221, 0.12);
  color: #e4c7ff;
  font-size: 0.82rem;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.top-settings-button:hover {
  background: rgba(157, 78, 221, 0.22);
  border-color: rgba(199, 125, 255, 0.45);
}

/* ── Slide-in plugin panels ───────────────────────────────── */
.shell-panel-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1200;
}

.shell-panel-mask[hidden] {
  display: none !important;
}

.shell-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: min(400px, 92vw);
  height: 100%;
  background: #1a1a2e;
  color: #eee;
  z-index: 1300;
  padding: 1.25rem;
  overflow-y: auto;
  transition: right 0.25s ease;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.45);
  border-left: 1px solid rgba(157, 78, 221, 0.25);
}

.shell-panel.open {
  right: 0;
}

.shell-panel label {
  display: block;
  margin: 0.75rem 0;
  font-size: 0.9rem;
}

.shell-panel input,
.shell-panel textarea,
.shell-panel select {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(157, 78, 221, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: inherit;
}

.panel-hint {
  opacity: 0.75;
  font-size: 0.85rem;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(157, 78, 221, 0.2);
}

.panel-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #e4c7ff;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.panel-btn {
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  border: 1px solid rgba(157, 78, 221, 0.35);
  background: rgba(157, 78, 221, 0.12);
  color: #e4c7ff;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.panel-btn:hover {
  background: rgba(157, 78, 221, 0.22);
  border-color: rgba(199, 125, 255, 0.45);
}

.panel-btn-primary {
  background: linear-gradient(135deg, #9d4edd, #7b2cbf);
  border-color: transparent;
  color: #fff;
}

.panel-btn-primary:hover {
  background: linear-gradient(135deg, #b76fe8, #9d4edd);
}

.panel-btn-ghost {
  margin-top: 0.5rem;
  background: transparent;
  border-color: rgba(157, 78, 221, 0.2);
  color: #8b8ba3;
  width: 100%;
}

.panel-btn-ghost:hover {
  color: #e4c7ff;
  background: rgba(157, 78, 221, 0.08);
}

.panel-hint code {
  font-size: 0.82em;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(157, 78, 221, 0.15);
}

.panel-status {
  margin: 0.75rem 0;
  font-size: 0.85rem;
  opacity: 0.9;
}

.explorer-table-wrap {
  overflow: auto;
  max-height: 50vh;
  margin-top: 0.75rem;
}

.explorer-table-wrap table {
  width: 100%;
  font-size: 0.75rem;
  border-collapse: collapse;
}

.explorer-table-wrap th,
.explorer-table-wrap td {
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.35rem 0.5rem;
  text-align: left;
}

.explorer-table-wrap th {
  position: sticky;
  top: 0;
  background: #252545;
  color: #e4c7ff;
  font-weight: 600;
}

.explorer-table-wrap tbody tr:nth-child(even) {
  background: rgba(157, 78, 221, 0.06);
}

.explorer-table-wrap tbody tr:hover {
  background: rgba(157, 78, 221, 0.12);
}

.mur-toolbar-btn {
  margin-right: 0.35rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(157, 78, 221, 0.25);
  background: transparent;
  color: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.boot-error {
  color: #f88;
  padding: 1rem;
}

#closeSet {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 1400;
  display: none;
  border: 1px solid rgba(157, 78, 221, 0.35);
  background: #252545;
  color: #e4c7ff;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  font-size: 0.82rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.shell-panel.open ~ #closeSet {
  display: block;
}

@media (max-width: 768px) {
  body.lf-chat-page {
    padding-top: 52px;
  }

  .main-chat-wrapper {
    padding: 0.5rem;
  }

  .credits-content {
    justify-content: center;
  }

  .credits-actions {
    margin-left: 0;
    justify-content: center;
    width: 100%;
  }

  .credits-bar p {
    flex: 1 1 100%;
    text-align: center;
    font-size: 0.8rem;
  }

  #closeSet {
    right: 0.65rem;
  }
}

/* ── Wave 1: model picker ───────────────────────────────────── */
.lf-model-picker-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem 1rem;
  padding: 0.35rem 0.5rem 0.5rem;
  border-bottom: 1px solid rgba(157, 78, 221, 0.12);
}

.lf-model-picker-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1 1 14rem;
  min-width: min(18rem, 70vw);
}

.lf-model-detail {
  margin: 0;
  font-size: 0.72rem;
  color: #9d9db8;
  opacity: 0.9;
}

.lf-model-picker-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  flex: 1 1 12rem;
}

.lf-model-rank-link {
  font-size: 0.72rem;
  color: #c77dff;
  text-decoration: none;
  white-space: nowrap;
}

.lf-model-rank-link:hover {
  text-decoration: underline;
}

.lf-model-picker-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.82rem;
  color: var(--mur-text-muted, #8b8ba3);
}

.lf-model-picker-title {
  white-space: nowrap;
}

.lf-model-picker-select {
  min-width: min(18rem, 70vw);
  max-width: 100%;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(157, 78, 221, 0.28);
  background: #1e1e32;
  color: #e8e8ef;
  font-size: 0.82rem;
}

.lf-model-picker-help {
  margin: 0;
  flex: 1 1 12rem;
  font-size: 0.72rem;
  opacity: 0.75;
  color: #8b8ba3;
}

.lf-use-model-btn {
  padding: 0.2rem 0.45rem;
  font-size: 0.7rem;
  white-space: nowrap;
}

/* ── Wave 1 / 6A: routing chip + failover timeline ───────────── */
.lf-routing-root {
  margin-top: 0.4rem;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: #8b8ba3;
}

.lf-routing-chip {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  max-width: 100%;
  margin: 0;
  padding: 0.2rem 0.45rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
  opacity: 0.95;
}

.lf-routing-chip:hover {
  border-color: rgba(157, 78, 221, 0.28);
  background: rgba(26, 26, 46, 0.55);
}

.lf-routing-chip:focus-visible {
  outline: 2px solid #c77dff;
  outline-offset: 2px;
}

.lf-routing-summary::before {
  content: "↳ ";
  opacity: 0.65;
}

.lf-usage-badge {
  color: #c4c4d4;
  opacity: 0.95;
}

.lf-routing-chevron {
  opacity: 0.7;
  font-size: 0.75em;
}

.lf-routing-chip[aria-expanded="true"] .lf-routing-chevron {
  transform: rotate(180deg);
}

.lf-routing-panel {
  margin-top: 0.4rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(157, 78, 221, 0.22);
  border-radius: 8px;
  background: rgba(18, 18, 31, 0.92);
}

.lf-routing-panel[hidden] {
  display: none !important;
}

.lf-hop-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.lf-hop-row {
  border: 1px solid rgba(157, 78, 221, 0.16);
  border-radius: 6px;
  padding: 0.4rem 0.5rem;
  background: rgba(26, 26, 46, 0.55);
}

.lf-hop-main {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  align-items: center;
  color: #c4c4d4;
}

.lf-hop-index {
  color: #8b8ba3;
  font-variant-numeric: tabular-nums;
}

.lf-hop-tier {
  color: #e8e8ef;
  font-weight: 600;
}

.lf-hop-endpoint,
.lf-hop-model {
  color: #8b8ba3;
  word-break: break-all;
}

.lf-hop-outcome {
  margin-left: auto;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lf-hop-outcome-success {
  color: #7dcea0;
  background: rgba(125, 206, 160, 0.12);
}

.lf-hop-outcome-skip {
  color: #f0c674;
  background: rgba(240, 198, 116, 0.12);
}

.lf-hop-outcome-error {
  color: #e88;
  background: rgba(238, 136, 136, 0.12);
}

.lf-hop-reason {
  margin: 0.3rem 0 0;
  color: #8b8ba3;
  font-size: 0.72rem;
}

.lf-alias-note {
  margin: 0.55rem 0 0;
  color: #8b8ba3;
  font-size: 0.72rem;
  line-height: 1.35;
}

.lf-routing-empty {
  margin: 0;
  color: #8b8ba3;
}

/* Wave 6A: session totals row */
.lf-session-totals {
  flex-shrink: 0;
  padding: 0.35rem 0.75rem;
  border-top: 1px solid rgba(157, 78, 221, 0.18);
  background: rgba(18, 18, 31, 0.85);
  font-size: 0.72rem;
  color: #8b8ba3;
  letter-spacing: 0.02em;
}

.lf-session-totals[hidden] {
  display: none !important;
}

/* ── Wave 5A: thinking + tool blocks ────────────────────────── */
#chatMount .mur-think-block {
  background: rgba(157, 78, 221, 0.08);
  border: 1px solid rgba(157, 78, 221, 0.15);
  border-radius: 8px;
  margin: 0.5rem 0;
}

#chatMount .mur-think-toggle {
  color: #c4c4d4;
  font-size: 0.78rem;
  padding: 0.35rem 0.5rem;
}

#chatMount .mur-think-toggle:hover {
  color: #e4c7ff;
  background: rgba(157, 78, 221, 0.1);
  border-radius: 6px;
}

#chatMount .mur-think-content {
  font-size: 0.85rem;
  color: #8b8ba3;
  line-height: 1.45;
  padding: 0 0.5rem 0.5rem;
}

#chatMount .mur-tool-call-card {
  background: rgba(26, 26, 46, 0.65);
  border: 1px solid rgba(157, 78, 221, 0.16);
  border-radius: 8px;
  margin: 0.4rem 0;
}

#chatMount .mur-tool-call-card:hover {
  border-color: rgba(157, 78, 221, 0.3);
}

#chatMount .mur-tool-call-name {
  color: #c77dff;
  font-weight: 600;
}

#chatMount .mur-tool-call-status {
  font-size: 0.75rem;
}

#chatMount .mur-tool-call-args {
  font-size: 0.78rem;
  color: #8b8ba3;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  padding: 0.35rem;
  margin: 0.35rem 0 0;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── Wave 1: hide unwired ResearchWizard chrome ─────────────── */
#voiceInputBtn,
.research-output-container,
#researchForm,
.mcp-config-panel,
.mcp-info-modal {
  display: none !important;
}

#chatMount .mur-chat-input:focus-visible,
#chatMount .mur-send-btn:focus-visible,
.lf-model-picker-select:focus-visible {
  outline: 2px solid rgba(199, 125, 255, 0.65);
  outline-offset: 2px;
}

/* ── Wave 2: endpoint health + status strip ─────────────────── */
.lf-endpoint-health {
  margin: 0.75rem 0 1rem;
}

.lf-endpoint-health-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  color: #c8c8dc;
}

.lf-endpoint-health-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.lf-health-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.78rem;
  color: #b8b8cc;
}

.lf-health-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.lf-health-ok { background: #4ade80; }
.lf-health-slow { background: #fbbf24; }
.lf-health-fail { background: #f87171; }
.lf-health-pending { opacity: 0.7; }

.lf-health-url {
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
  word-break: break-all;
}

.lf-health-hint {
  flex: 1 1 100%;
  font-size: 0.72rem;
  color: #fbbf24;
}

.lf-status-strip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #a8a8bc;
  min-width: 0;
  flex: 0 1 auto;
}

.lf-status-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.lf-status-ok { background: #4ade80; }
.lf-status-fail { background: #f87171; }
.lf-status-warn { background: #fbbf24; }

.lf-status-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 14rem;
}

.lf-turnstile-mount {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 9999;
}

@media (max-width: 768px) {
  .lf-status-strip {
    flex: 1 1 100%;
    justify-content: center;
  }

  .lf-status-text {
    max-width: 100%;
  }
}

/* ── Wave 3: catalog badges + explorer ──────────────────────── */
.lf-cap-badge {
  display: inline-block;
  margin: 0 0.15rem 0.15rem 0;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.65rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: rgba(157, 78, 221, 0.18);
  color: #d4b8ff;
  border: 1px solid rgba(157, 78, 221, 0.25);
}

.lf-cap-vision {
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.28);
}

.lf-cap-tools {
  background: rgba(74, 222, 128, 0.1);
  color: #86efac;
  border-color: rgba(74, 222, 128, 0.25);
}

.explorer-table-wrap td {
  vertical-align: middle;
}

/* ── Wave 4: streaming polish + shortcuts ───────────────────── */
#chatMount .mur-streaming-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  line-height: 1.55;
  contain: content;
}

#chatMount .mur-message-assistant.mur-generating .mur-content-block {
  min-height: 1.5em;
}

.lf-shortcuts-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lf-shortcuts-modal[hidden] {
  display: none !important;
}

.lf-shortcuts-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
}

.lf-shortcuts-panel {
  position: relative;
  z-index: 1;
  width: min(22rem, 92vw);
  padding: 1.25rem 1.35rem;
  border-radius: 12px;
  background: #1a1a2e;
  border: 1px solid rgba(157, 78, 221, 0.28);
  box-shadow: var(--mur-shadow-modal, 0 10px 28px rgba(0, 0, 0, 0.45));
}

.lf-shortcuts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.lf-shortcuts-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #e8e8ef;
}

.lf-shortcuts-close {
  border: none;
  background: transparent;
  color: #8b8ba3;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.lf-shortcuts-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lf-shortcuts-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(157, 78, 221, 0.12);
  font-size: 0.88rem;
  color: #c4c4d4;
}

.lf-shortcuts-list li:last-child {
  border-bottom: none;
}

.lf-shortcuts-list kbd {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
  background: rgba(157, 78, 221, 0.16);
  border: 1px solid rgba(157, 78, 221, 0.28);
  color: #e4c7ff;
  font-family: inherit;
  font-size: 0.78rem;
}

.lf-shortcuts-hint {
  position: absolute;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  background: rgba(26, 26, 46, 0.92);
  border: 1px solid rgba(157, 78, 221, 0.25);
  color: #c4c4d4;
  font-size: 0.82rem;
  pointer-events: auto;
}

.lf-shortcuts-hint[hidden] {
  display: none !important;
}

.lf-shortcuts-hint kbd {
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(157, 78, 221, 0.2);
  border: 1px solid rgba(157, 78, 221, 0.3);
  font-size: 0.75rem;
}

.lf-shortcuts-hint-dismiss {
  border: none;
  background: transparent;
  color: #8b8ba3;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.lf-shortcuts-footer-link {
  border: none;
  background: transparent;
  color: #8b8ba3;
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0 0.35rem;
}

.lf-shortcuts-footer-link:hover {
  color: #c77dff;
}

/* Wave 4B: image attachment tray — inherits murm-ui attachment vars from the
   dark theme block above; these rules just tighten thumbnail framing so the
   composer tray matches the dark shell. */
#chatMount .mur-attachment-previews {
  gap: 0.4rem;
}

#chatMount .mur-attachment-preview-item img,
#chatMount .mur-attachment-image {
  border-radius: 8px;
  border: 1px solid var(--mur-border);
}

/* Wave 4B: provider tier settings panel */
.lf-tier-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.lf-tier-row {
  border: 1px solid rgba(157, 78, 221, 0.22);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: rgba(26, 26, 46, 0.55);
}

.lf-tier-row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.lf-tier-enable {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-weight: 600;
  color: #e8e8ef;
}

.lf-tier-enable input {
  width: auto;
  margin: 0;
}

.lf-tier-move {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.lf-tier-move .panel-btn {
  min-width: 2rem;
  padding: 0.2rem 0.45rem;
}

.lf-tier-hint {
  margin: 0.35rem 0 0;
}

/* Wave 4B: compare mode split-pane */
.lf-compare-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.35rem 0.15rem 0.55rem;
}

.lf-compare-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-weight: 600;
  color: #e8e8ef;
  cursor: pointer;
}

.lf-compare-toggle input {
  width: auto;
  margin: 0;
}

.lf-compare-toggle-hint {
  font-size: 0.78rem;
  color: #8b8ba3;
}

.lf-compare-chrome {
  padding: 0.5rem 0.75rem 0.85rem;
  border-top: 1px solid rgba(157, 78, 221, 0.22);
  background: rgba(18, 18, 31, 0.92);
  flex-shrink: 0;
}

.lf-compare-chrome[hidden] {
  display: none !important;
}

.lf-compare-banner {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(127, 29, 29, 0.28);
  color: #fecaca;
  font-size: 0.82rem;
}

.lf-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 720px) {
  .lf-compare-grid {
    grid-template-columns: 1fr;
  }
}

.lf-compare-column {
  border: 1px solid rgba(157, 78, 221, 0.22);
  border-radius: 10px;
  background: rgba(26, 26, 46, 0.65);
  min-height: 8rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lf-compare-column-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(157, 78, 221, 0.18);
}

.lf-compare-column-title {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8b8ba3;
  margin-bottom: 0.2rem;
}

.lf-compare-model {
  width: 100%;
  max-width: 100%;
}

.lf-compare-live-label {
  font-size: 0.75rem;
  color: #c77dff;
  word-break: break-all;
}

.lf-compare-pane {
  flex: 1;
  padding: 0.65rem 0.75rem;
  white-space: pre-wrap;
  color: #e8e8ef;
  font-size: 0.92rem;
  line-height: 1.45;
  min-height: 5rem;
}

.lf-compare-pane:empty::before {
  content: "Waiting for reply…";
  color: #8b8ba3;
  font-style: italic;
}

#chatMount.lf-compare-active .mur-chat-history {
  /* Keep history visible above the live compare panes */
  max-height: 42vh;
}

/* Wave 4B: SearXNG discovery pick list */
.lf-discovery-picklist {
  flex-shrink: 0;
  padding: 0.55rem 0.75rem;
  border-top: 1px solid rgba(157, 78, 221, 0.22);
  background: rgba(18, 18, 31, 0.92);
}

.lf-discovery-picklist[hidden] {
  display: none !important;
}

.lf-discovery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #c4c4d4;
}

.lf-discovery-dismiss {
  min-width: 1.8rem;
  padding: 0.1rem 0.4rem;
}

.lf-discovery-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lf-discovery-item {
  border: 1px solid rgba(157, 78, 221, 0.22);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  background: rgba(26, 26, 46, 0.6);
}

.lf-discovery-item a {
  color: #c77dff;
  font-weight: 600;
  text-decoration: none;
}

.lf-discovery-item a:hover {
  text-decoration: underline;
}

.lf-discovery-url {
  display: block;
  font-size: 0.72rem;
  color: #8b8ba3;
  word-break: break-all;
}

.lf-discovery-snippet {
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
  color: #c4c4d4;
}

