/* GENEON side panel, injected into LibreChat by web/nginx.conf. */

:root {
  --geneon-panel-width: max(320px, 33.333vw);  /* a third of the window, but never too narrow */
  --geneon-panel-bg: #f7f7f8;
  --geneon-panel-fg: #1f2328;
  --geneon-panel-muted: #6b7280;
  --geneon-panel-border: #e5e7eb;
  --geneon-panel-hover: #ececef;
}
html.dark {
  --geneon-panel-bg: #171717;
  --geneon-panel-fg: #ececec;
  --geneon-panel-muted: #9ca3af;
  --geneon-panel-border: #2f2f2f;
  --geneon-panel-hover: #262626;
}

/* Make room for the panel: LibreChat's layout fills the body, so padding shrinks it. */
html[data-geneon-panel="open"] body {
  padding-right: var(--geneon-panel-width);
  box-sizing: border-box;
}

#geneon-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  width: var(--geneon-panel-width);
  display: flex;
  flex-direction: column;
  background: var(--geneon-panel-bg);
  color: var(--geneon-panel-fg);
  border-left: 1px solid var(--geneon-panel-border);
  font-family: inherit;
  font-size: 14px;
}
html:not([data-geneon-panel="open"]) #geneon-panel { display: none; }

#geneon-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 8px 0 16px;
  border-bottom: 1px solid var(--geneon-panel-border);
  font-weight: 600;
}
#geneon-panel .geneon-panel-actions { display: flex; align-items: center; gap: 8px; }
#geneon-panel .geneon-panel-link {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--geneon-panel-fg);
  border-radius: 8px;
  background: var(--geneon-panel-fg);  /* inverted: dark button, light text */
  color: var(--geneon-panel-bg);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
#geneon-panel .geneon-panel-link:hover { opacity: .85; }
#geneon-panel .geneon-panel-link[hidden] { display: none; }

/* The logo is black ink on transparent; flip it to white on the dark theme. */
#geneon-panel .geneon-panel-logo { display: block; height: 36px; width: auto; }
#geneon-panel .geneon-panel-logo[hidden], #geneon-panel .geneon-panel-org[hidden] { display: none; }
html.dark #geneon-panel .geneon-panel-logo { filter: invert(1); }
#geneon-panel .geneon-panel-org { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
#geneon-panel .geneon-panel-org-name { font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#geneon-panel .geneon-panel-org a { font-size: 12px; text-decoration: underline; color: inherit; opacity: .75; }

#geneon-panel .geneon-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  color: var(--geneon-panel-muted);
  line-height: 1.5;
}

.geneon-panel-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--geneon-panel-border);
  border-radius: 8px;
  background: var(--geneon-panel-bg);
  color: var(--geneon-panel-fg);
  cursor: pointer;
}
.geneon-panel-button:hover { background: var(--geneon-panel-hover); }
.geneon-panel-button:focus-visible { outline: 2px solid #4f8a5b; outline-offset: 2px; }

/* Hidden on sign-in pages. */
html[data-geneon-panel-hidden] #geneon-panel { display: none; }
html[data-geneon-panel-hidden] body { padding-right: 0; }

/* Phones: no room for a panel beside the chat, and it can't be collapsed, so leave it out. */
@media (max-width: 767px) {
  #geneon-panel { display: none; }
  html[data-geneon-panel="open"] body { padding-right: 0; }
}

/* Plasmid map */
#geneon-panel .geneon-empty { margin: 0 0 10px; }
#geneon-panel .geneon-map-title { margin: 0; font-size: 15px; font-weight: 600; color: var(--geneon-panel-fg); }
#geneon-panel .geneon-map-sub { margin: 2px 0 8px; font-size: 12px; }
#geneon-panel .geneon-map { display: block; width: 100%; height: auto; color: var(--geneon-panel-fg); }
#geneon-panel .geneon-features { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 12px; color: var(--geneon-panel-fg); }
#geneon-panel .geneon-features th { text-align: left; font-weight: 600; color: var(--geneon-panel-muted); padding: 4px 4px 4px 0; border-bottom: 1px solid var(--geneon-panel-border); }
#geneon-panel .geneon-features td { padding: 4px 4px 4px 0; border-bottom: 1px solid var(--geneon-panel-border); font-variant-numeric: tabular-nums; vertical-align: top; }
#geneon-panel .geneon-features td:nth-child(2) { white-space: nowrap; }
#geneon-panel .geneon-swatch { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 2px; vertical-align: 1px; }

/* Greyed-out example plasmid shown until the user supplies their own. */
#geneon-panel .geneon-example { opacity: .7; filter: grayscale(1); }

/* Parts cards above the map */
#geneon-panel .geneon-parts { margin-bottom: 14px; }
#geneon-panel .geneon-parts h4 { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--geneon-panel-muted); text-transform: uppercase; letter-spacing: .04em; }
#geneon-panel .geneon-parts ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }  /* one full-width card per row */
#geneon-panel .geneon-part {
  display: grid; grid-template-columns: 10px minmax(0, 1fr); column-gap: 10px; row-gap: 2px; align-items: center;
  padding: 8px 10px; border: 1px solid var(--geneon-panel-border);
  border-radius: 8px; background: var(--geneon-panel-hover);
}
/* A dot in the part's map colour links the card to its arc on the map. */
#geneon-panel .geneon-part::before {
  content: ""; grid-row: 1; width: 10px; height: 10px; border-radius: 50%; background: var(--part-color);
}
/* The part's bases, as many as fit on one line. */
#geneon-panel .geneon-part-seq {
  font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em;
  color: var(--geneon-panel-fg); opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#geneon-panel .geneon-part > * { grid-column: 2; }
#geneon-panel .geneon-part-name { font-size: 13px; font-weight: 600; color: var(--geneon-panel-fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#geneon-panel .geneon-part-bp { font-weight: 400; color: var(--geneon-panel-muted); font-variant-numeric: tabular-nums; }
#geneon-panel .geneon-example .geneon-part-seq { font-family: inherit; letter-spacing: 0; color: var(--geneon-panel-muted); }
#geneon-panel .geneon-parts:not(.geneon-parts-expanded) .geneon-part-row:nth-child(n + 7) { display: none; }
#geneon-panel .geneon-parts-more {
  width: 100%; margin-top: 6px; padding: 6px 10px; border: 1px dashed var(--geneon-panel-border);
  border-radius: 8px; background: none; color: var(--geneon-panel-muted); font: inherit; font-size: 12px; cursor: pointer;
}
#geneon-panel .geneon-parts-more:hover { background: var(--geneon-panel-hover); color: var(--geneon-panel-fg); }

/* Parts header: title, and the Confirm button once the user has parts to check. */
#geneon-panel .geneon-parts-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
#geneon-panel .geneon-parts-head h4 { margin: 0; }
#geneon-panel .geneon-confirm {
  height: 28px; padding: 0 12px; border: 0; border-radius: 7px; cursor: pointer;
  background: var(--geneon-panel-fg); color: var(--geneon-panel-bg); font: inherit; font-size: 12px; font-weight: 600;
}
#geneon-panel .geneon-confirm:hover { opacity: .85; }
#geneon-panel .geneon-confirm:disabled { opacity: .5; cursor: default; }
#geneon-panel .geneon-confirmed { font-size: 12px; font-weight: 600; color: #16a34a; }

/* Organisation and its resources */
#geneon-panel .geneon-org { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--geneon-panel-border); }
#geneon-panel .geneon-org h4 { margin: 0 0 4px; font-size: 12px; font-weight: 600; color: var(--geneon-panel-muted); text-transform: uppercase; letter-spacing: .04em; }
#geneon-panel .geneon-org-name { margin: 0 0 8px; font-size: 15px; font-weight: 600; color: var(--geneon-panel-fg); }
#geneon-panel .geneon-org ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--geneon-panel-fg); }
#geneon-panel .geneon-org-type { color: var(--geneon-panel-muted); text-transform: uppercase; font-size: 10px; letter-spacing: .04em; }
#geneon-panel .geneon-org-notes { display: block; color: var(--geneon-panel-muted); }
#geneon-panel .geneon-org-link { display: inline-block; margin-top: 10px; font-size: 12px; color: var(--geneon-panel-fg); text-decoration: underline; }

/* File upload */
#geneon-panel .geneon-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px 10px; border-top: 1px solid var(--geneon-panel-border); }
#geneon-panel .geneon-upload { display: flex; }
#geneon-panel .geneon-upload-title { font-size: 13px; font-weight: 600; }
#geneon-panel .geneon-upload-types { font-size: 10.5px; font-weight: 400; line-height: 1.35; opacity: .75; }
#geneon-panel .geneon-upload-button {
  font: inherit; font-size: 13px; font-weight: 600; width: 100%; height: 30px; padding: 0 10px; border-radius: 6px; cursor: pointer;
  border: 1px solid #2c6fbb; background: transparent; color: #2c6fbb;
}
#geneon-panel .geneon-actions .geneon-download-all { height: 30px; padding: 0 10px; margin: 0; font-size: 13px; }
#geneon-panel .geneon-upload-button:hover { background: rgba(44, 111, 187, .1); }
#geneon-panel .geneon-upload-button:disabled { opacity: .5; cursor: default; }
#geneon-panel .geneon-upload-status { margin: 6px 0 0; font-size: 12px; line-height: 1.4; }
#geneon-panel .geneon-upload-status:empty { display: none; }
#geneon-panel .geneon-upload-error { color: #c0392b; }
/* The package button in the bottom bar */
.geneon-download {
  font: inherit; font-size: 12px; cursor: pointer; border-radius: 6px; padding: 3px 8px;
  border: 1px solid #2f6b3a; background: transparent; color: #2f6b3a;
}
.geneon-download:hover:not(:disabled) { background: rgba(47, 107, 58, 0.1); }
.geneon-download:disabled { opacity: 0.6; cursor: default; }
.geneon-download-all { background: #2f6b3a; color: #fff; padding: 6px 10px; font-size: 13px; font-weight: 600; }
.geneon-download-all:hover:not(:disabled) { background: #265a30; }

/* Project: its name under the header (click to rename), the switcher, and the Projects list. */
#geneon-panel .geneon-project { position: relative; padding: 10px 14px 8px; border-bottom: 1px solid var(--geneon-panel-border); }
#geneon-panel .geneon-project[hidden] { display: none; }
#geneon-panel .geneon-project-row { display: flex; align-items: center; gap: 4px; }
#geneon-panel .geneon-project-name {
  flex: 1; min-width: 0; padding: 4px 6px; border: 1px solid transparent; border-radius: 6px; background: none; color: inherit;
  font: inherit; font-size: 15px; font-weight: 600; text-align: left; cursor: text; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#geneon-panel .geneon-project-name:hover { border-color: var(--geneon-panel-border); background: var(--geneon-panel-hover); }
#geneon-panel .geneon-project-none { font-weight: 400; color: var(--geneon-panel-muted); }
#geneon-panel .geneon-project-input {
  flex: 1; min-width: 0; padding: 4px 6px; border: 1px solid #2c6fbb; border-radius: 6px; background: var(--geneon-panel-bg);
  color: inherit; font: inherit; font-size: 15px; font-weight: 600;
}
#geneon-panel .geneon-project-switch {
  width: 28px; height: 28px; border: 1px solid var(--geneon-panel-border); border-radius: 6px; background: none; color: inherit; cursor: pointer;
}
#geneon-panel .geneon-project-switch:hover { background: var(--geneon-panel-hover); }
#geneon-panel .geneon-project-error { margin: 6px 0 0; font-size: 12px; color: #c0392b; }
#geneon-panel .geneon-project-note { margin: 6px 0 0; font-size: 12px; line-height: 1.4; }
#geneon-panel .geneon-project-error[hidden], #geneon-panel .geneon-project-note[hidden], #geneon-panel .geneon-project-menu[hidden] { display: none; }
#geneon-panel .geneon-project-menu {
  position: absolute; left: 14px; right: 14px; top: calc(100% - 4px); z-index: 5; max-height: 50vh; overflow-y: auto; padding: 4px;
  background: var(--geneon-panel-bg); border: 1px solid var(--geneon-panel-border); border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}
#geneon-panel .geneon-project-menu hr { margin: 4px 0; border: 0; border-top: 1px solid var(--geneon-panel-border); }
#geneon-panel .geneon-menu-item {
  display: flex; align-items: center; gap: 6px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; background: none; color: inherit;
  font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
#geneon-panel .geneon-menu-item:hover { background: var(--geneon-panel-hover); }
#geneon-panel .geneon-menu-check { display: inline-block; width: 14px; color: #2c6fbb; }
#geneon-panel .geneon-menu-muted { color: var(--geneon-panel-muted); }
#geneon-panel .geneon-menu-title { margin: 4px 8px; font-size: 12px; font-weight: 600; color: var(--geneon-panel-muted); }
#geneon-panel .geneon-menu-empty { margin: 4px 8px; font-size: 12px; color: var(--geneon-panel-muted); }
#geneon-panel .geneon-link-button { padding: 0; border: 0; background: none; color: #2c6fbb; font: inherit; text-decoration: underline; cursor: pointer; text-align: left; }
#geneon-panel .geneon-projects-view {
  position: absolute; top: 56px; left: 0; right: 0; bottom: 0; z-index: 6; padding: 14px; overflow-y: auto; background: var(--geneon-panel-bg);
}
#geneon-panel .geneon-projects-view[hidden] { display: none; }
#geneon-panel .geneon-projects-head { display: flex; align-items: center; justify-content: space-between; }
#geneon-panel .geneon-projects-head h4 { margin: 0; font-size: 15px; }
#geneon-panel .geneon-archived-toggle { display: block; margin: 8px 0; font-size: 12px; color: var(--geneon-panel-muted); }
#geneon-panel .geneon-projects-table { width: 100%; border-collapse: collapse; font-size: 12px; }
#geneon-panel .geneon-projects-table th { padding: 4px 6px 4px 0; text-align: left; font-weight: 500; color: var(--geneon-panel-muted); }
#geneon-panel .geneon-projects-table td { padding: 6px 6px 6px 0; border-top: 1px solid var(--geneon-panel-border); vertical-align: top; word-break: break-word; }
#geneon-panel .geneon-projects-table .geneon-archived td:first-child { color: var(--geneon-panel-muted); }
#geneon-panel .geneon-projects-foot { margin-top: 12px; }
#geneon-panel .geneon-secondary {
  padding: 6px 12px; border: 1px solid #2c6fbb; border-radius: 8px; background: none; color: #2c6fbb; font: inherit; font-size: 13px; cursor: pointer;
}
#geneon-panel .geneon-secondary:hover { background: rgba(44, 111, 187, .1); }

/* A part and its source side by side */
#geneon-panel .geneon-part-row { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 6px; }
#geneon-panel .geneon-source { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 8px 10px; border: 1px solid var(--geneon-panel-border); border-radius: 8px; background: var(--geneon-panel-hover); min-width: 0; }
#geneon-panel .geneon-source-label { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
#geneon-panel .geneon-source-detail { font-size: 11px; opacity: .7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#geneon-panel .geneon-source-empty { opacity: .4; }
#geneon-panel .geneon-source-empty .geneon-source-label { font-weight: 400; font-style: italic; }

/* Confirm controls sit under the part and source cards, in the same two columns */
#geneon-panel .geneon-confirm-bar { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 6px; margin-top: 6px; }
#geneon-panel .geneon-confirm-bar .geneon-confirm { width: 100%; height: 34px; border-radius: 8px; }
#geneon-panel .geneon-confirm-bar .geneon-confirm:disabled { opacity: .35; cursor: not-allowed; }
#geneon-panel .geneon-confirmed-card {
  display: flex; align-items: center; justify-content: center; height: 34px; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--geneon-panel-border); background: var(--geneon-panel-hover);
  font-size: 12px; font-weight: 600; color: #16a34a;
}
#geneon-panel .geneon-actions .geneon-download-all:disabled { opacity: .4; cursor: not-allowed; }

/* One card, two rows: resources; then assembly method (left) and estimated cost (right) */
#geneon-panel .geneon-summary { margin-top: 12px; border: 1px solid var(--geneon-panel-border); border-radius: 8px; background: var(--geneon-panel-hover); }
#geneon-panel .geneon-summary-row + .geneon-summary-row { border-top: 1px solid var(--geneon-panel-border); }
#geneon-panel .geneon-summary-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
#geneon-panel .geneon-summary-split .geneon-summary-cell + .geneon-summary-cell { border-left: 1px solid var(--geneon-panel-border); }
#geneon-panel .geneon-summary-cell { padding: 8px 10px; min-width: 0; }
#geneon-panel .geneon-summary-cell h4 { margin: 0 0 2px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; opacity: .65; }
#geneon-panel .geneon-summary-value { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
#geneon-panel .geneon-summary-value span { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
#geneon-panel .geneon-summary-value em { font-weight: 400; font-style: normal; font-size: 11px; opacity: .65; margin-left: 4px; }
#geneon-panel .geneon-summary-value small { font-size: 11px; opacity: .7; }
#geneon-panel .geneon-summary-empty .geneon-summary-value span { font-weight: 400; font-style: italic; opacity: .45; }
