:root {
  --lcf-bg: rgba(5, 9, 23, 0.9);
  --lcf-panel: rgba(12, 20, 42, 0.94);
  --lcf-border: rgba(94, 234, 212, 0.24);
  --lcf-cyan: #5eead4;
  --lcf-blue: #60a5fa;
  --lcf-violet: #c084fc;
  --lcf-green: #34d399;
  --lcf-amber: #fbbf24;
  --lcf-red: #fb7185;
  --lcf-text: #e6f2ff;
  --lcf-muted: #8190b4;
}

.lcf-rail {
  position: fixed;
  z-index: 950;
  left: 50%;
  bottom: 16px;
  width: min(1120px, calc(100vw - 28px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--lcf-text);
  background:
    linear-gradient(135deg, rgba(94, 234, 212, 0.07), transparent 34%),
    linear-gradient(225deg, rgba(192, 132, 252, 0.08), transparent 38%),
    var(--lcf-bg);
  border: 1px solid var(--lcf-border);
  border-radius: 16px;
  box-shadow:
    0 20px 70px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 36px rgba(94, 234, 212, 0.08);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  backdrop-filter: blur(18px) saturate(145%);
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

.lcf-rail::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(94, 234, 212, 0.2), transparent);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  padding: 1px;
}

.lcf-nav {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.lcf-nav::-webkit-scrollbar {
  display: none;
}

.lcf-link,
.lcf-command-button {
  appearance: none;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 7px 10px;
  color: var(--lcf-muted);
  background: transparent;
  font: 700 9px/1 "Orbitron", "Segoe UI", sans-serif;
  letter-spacing: 1.35px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: 160ms ease;
}

.lcf-link:hover,
.lcf-link.active,
.lcf-command-button:hover {
  color: var(--lcf-cyan);
  border-color: rgba(94, 234, 212, 0.35);
  background: rgba(94, 234, 212, 0.07);
  box-shadow: 0 0 18px rgba(94, 234, 212, 0.1);
}

.lcf-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  white-space: nowrap;
}

.lcf-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 5px 9px;
  border: 1px solid rgba(129, 144, 180, 0.26);
  border-radius: 999px;
  color: var(--lcf-muted);
  background: rgba(4, 8, 20, 0.62);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.lcf-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.lcf-chip[data-tone="good"] { color: var(--lcf-green); }
.lcf-chip[data-tone="paper"] { color: var(--lcf-blue); }
.lcf-chip[data-tone="shadow"] { color: var(--lcf-violet); }
.lcf-chip[data-tone="warn"] { color: var(--lcf-amber); }
.lcf-chip[data-tone="bad"] { color: var(--lcf-red); }

.lcf-command-button {
  border-color: rgba(129, 144, 180, 0.24);
  background: rgba(255, 255, 255, 0.025);
}

.lcf-command-button kbd {
  margin-left: 6px;
  color: rgba(230, 242, 255, 0.54);
  font: inherit;
}

.lcf-palette {
  position: fixed;
  z-index: 980;
  inset: 0;
  display: none;
  place-items: start center;
  padding: min(16vh, 140px) 16px 20px;
  background: rgba(2, 5, 14, 0.68);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.lcf-palette.open {
  display: grid;
}

.lcf-dialog {
  width: min(680px, 100%);
  overflow: hidden;
  border: 1px solid rgba(94, 234, 212, 0.3);
  border-radius: 18px;
  color: var(--lcf-text);
  background: var(--lcf-panel);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.62), 0 0 50px rgba(94, 234, 212, 0.1);
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

.lcf-search {
  width: 100%;
  border: 0 !important;
  border-bottom: 1px solid rgba(129, 144, 180, 0.2) !important;
  border-radius: 0 !important;
  padding: 18px 20px !important;
  color: var(--lcf-text) !important;
  background: rgba(3, 7, 18, 0.72) !important;
  box-shadow: none !important;
  font: 600 14px/1.4 "JetBrains Mono", ui-monospace, monospace !important;
}

.lcf-results {
  max-height: min(58vh, 480px);
  overflow-y: auto;
  padding: 8px;
}

.lcf-result {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 12px 13px;
  color: var(--lcf-text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.lcf-result:hover,
.lcf-result.active {
  border-color: rgba(94, 234, 212, 0.26);
  background: rgba(94, 234, 212, 0.07);
}

.lcf-result strong {
  display: block;
  font: 700 12px/1.2 "Orbitron", "Segoe UI", sans-serif;
  letter-spacing: 1px;
}

.lcf-result span {
  display: block;
  margin-top: 4px;
  color: var(--lcf-muted);
  font-size: 10px;
}

.lcf-result code {
  color: var(--lcf-cyan);
  font-size: 10px;
}

.lc-live[data-mode="paper"] {
  color: var(--lcf-blue) !important;
  border-color: rgba(96, 165, 250, 0.46) !important;
  background: rgba(96, 165, 250, 0.12) !important;
}

.lc-live[data-mode="shadow"] {
  color: var(--lcf-violet) !important;
  border-color: rgba(192, 132, 252, 0.46) !important;
  background: rgba(192, 132, 252, 0.12) !important;
}

.lc-live[data-mode="offline"] {
  color: var(--lcf-red) !important;
  border-color: rgba(251, 113, 133, 0.46) !important;
  background: rgba(251, 113, 133, 0.12) !important;
}

[data-runtime-mode][data-mode="paper"] {
  color: var(--lcf-blue) !important;
  border-color: rgba(96, 165, 250, 0.46) !important;
  background: rgba(96, 165, 250, 0.12) !important;
}

[data-runtime-mode][data-mode="shadow"] {
  color: var(--lcf-violet) !important;
  border-color: rgba(192, 132, 252, 0.46) !important;
  background: rgba(192, 132, 252, 0.12) !important;
}

[data-runtime-mode][data-mode="offline"] {
  color: var(--lcf-red) !important;
  border-color: rgba(251, 113, 133, 0.46) !important;
  background: rgba(251, 113, 133, 0.12) !important;
}

@media (max-width: 820px) {
  .lcf-rail {
    grid-template-columns: 1fr;
    gap: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
  }
  .lcf-status {
    justify-content: space-between;
  }
  .lcf-status .lcf-chip:nth-child(2) {
    display: none;
  }
  .lcf-command-button {
    margin-left: auto;
  }
}

@media (max-width: 520px) {
  .lcf-link {
    padding: 7px 8px;
  }
  .lcf-chip {
    padding: 5px 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lcf-link,
  .lcf-command-button,
  .lcf-result {
    transition: none;
  }
}
