/* Peptide / LC-MS module (peptide-studio.js). Colours come from the app's own
   tokens so the dark theme follows without a separate rule set; the plots
   themselves stay on white paper like the Tables plots. */

.pep-empty { padding: 22px; color: var(--muted, #64748b); line-height: 1.55; font-size: 14px; }
.muted { color: var(--muted, #64748b); }

/* ---- chromatogram ---- */
.lc-toolbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 14px; font-size: 13px; }
.lc-toolbar label { display: inline-flex; gap: 6px; align-items: center; }
.lc-toolbar input, .lc-toolbar select, .pep-panel input, .pep-panel select, .pep-panel textarea {
  font: inherit; font-size: 13px; padding: 4px 6px; border-radius: 6px;
  border: 1px solid var(--line, #d7dde2); background: var(--panel, #fff); color: var(--ink, #1c2a33);
}
.lc-sep { width: 1px; height: 22px; background: var(--line, #d7dde2); }
.lc-chart { padding: 0 14px; }
.lc-svg { width: 100%; height: 300px; display: block; border-radius: 8px; cursor: crosshair; touch-action: none; user-select: none; }
.lc-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 8px 14px 12px; font-size: 12.5px; }

/* ---- shared tables ---- */
.pep-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pep-table th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted, #64748b); padding: 6px 8px; border-bottom: 1px solid var(--line, #d7dde2); white-space: nowrap; }
.pep-table td { padding: 6px 8px; border-bottom: 1px solid var(--line, #eef1f3); vertical-align: top; }
.pep-table .mono, .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.pep-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; }
.pep-chip { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11.5px; background: rgba(148,163,184,.18); margin: 1px 2px; white-space: nowrap; }
.pep-chip.good { background: rgba(34,197,94,.18); }
.pep-chip.warn { background: rgba(245,158,11,.2); }
.pep-chip.bad { background: rgba(239,68,68,.18); }

/* ---- compound detection ---- */
.pep-settings { border-bottom: 1px solid var(--line, #e2e8f0); }
.pep-summary { padding: 10px 14px; font-size: 13.5px; }
.pep-note { padding: 6px 14px 12px; font-size: 12px; line-height: 1.5; }
.pep-panel .pep-table { margin: 0 6px; width: calc(100% - 12px); }
.pep-tool.active { background: #ef4444; color: #fff; border-color: #ef4444; }

/* ---- peptide builder ---- */
.pep-panel .pep-section { padding: 12px 14px; border-bottom: 1px solid var(--line, #e2e8f0); }
.pep-panel h4 { margin: 0 0 10px; font-size: 15px; }
.pep-quick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.pep-quick input { flex: 1 1 420px; font-family: ui-monospace, Consolas, monospace; }
.pep-error { color: #dc2626; font-size: 13px; margin: 4px 0 8px; }
.pep-chain { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pep-term { display: inline-flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted, #64748b); }
.pep-term select { max-width: 190px; }
.pep-tiles { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 300px; }
.pep-tile { position: relative; min-width: 54px; height: 58px; border-radius: 10px; border: 1.5px solid var(--line, #cbd5e1); background: var(--panel, #fff); color: var(--ink, #1c2a33); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px 6px; font: inherit; }
.pep-tile b { font-size: 18px; line-height: 1.1; }
.pep-tile small { font-size: 10.5px; color: var(--muted, #64748b); }
.pep-tile .pep-tile-n { position: absolute; top: 2px; left: 5px; font-size: 9.5px; color: var(--muted, #94a3b8); }
.pep-tile.sel { border-color: #14b8a6; box-shadow: 0 0 0 3px rgba(20,184,166,.25); }
.pep-tile.pg-kept small { color: #b45309; font-weight: 600; }
.pep-tile.pg-off small { text-decoration: line-through; }
.pep-tile.add { font-size: 22px; border-style: dashed; color: #14b8a6; }
.pep-legend { font-size: 11.5px; margin: 6px 0 8px; }
.pep-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: 0; }
.pep-dot.kept { background: #b45309; } .pep-dot.off { background: #94a3b8; }
.pep-editor { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 14px; padding: 10px 12px; border-radius: 10px; background: rgba(20,184,166,.07); border: 1px solid rgba(20,184,166,.3); margin: 4px 0 10px; }
.pep-editor label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted, #64748b); }
.pep-editor-title { grid-column: 1 / -1; font-size: 13px; }
.pep-editor-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.pep-editor .danger { color: #dc2626; }
.pep-summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px 16px; margin: 6px 0 10px; font-size: 13px; }
.pep-summary-grid div { display: flex; flex-direction: column; }
.pep-summary-grid b { overflow-wrap: anywhere; }
.pep-ions { margin: 6px 0; }
.pep-details { margin-top: 6px; font-size: 13px; }
.pep-details summary { cursor: pointer; }
.pep-reagents { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px 16px; }
.pep-rg-role { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, #64748b); margin-bottom: 3px; }
.pep-rg { display: flex; gap: 6px; align-items: baseline; font-size: 12.5px; padding: 2px 4px; border-radius: 6px; cursor: pointer; }
.pep-rg span { color: var(--muted, #64748b); font-size: 11.5px; }
.pep-rg.on { background: rgba(20,184,166,.12); }
.pep-custom { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; font-size: 13px; }
.pep-x { border: 0; background: none; cursor: pointer; color: inherit; padding: 0 2px; }
.pep-warn { color: #b45309; }
.pep-match td { font-size: 12.5px; }
.pep-match .small, .pep-panel .small { font-size: 11.5px; }
.pep-alt td { background: rgba(148,163,184,.08); }
.pep-unexpl td { opacity: .7; }
.pep-beads { display: block; margin: 6px 0 2px; border-radius: 6px; max-width: 100%; height: auto; }
.pep-verdict { font-size: 15px; padding: 8px 12px; border-radius: 8px; margin-bottom: 6px; }
.pep-verdict.good { background: rgba(34,197,94,.15); }
.pep-verdict.warn { background: rgba(245,158,11,.18); }
.pep-verdict.bad { background: rgba(239,68,68,.15); }
.pep-tool.target { border-color: #22c55e; }

/* Two more buttons on the chart toolbar: let it wrap instead of pushing
   Reset view / Full screen off the edge of a narrow window. */
.chart-toolbar { flex-wrap: wrap; row-gap: 8px; }

html[data-theme="dark"] .pep-panel select, html[data-theme="dark"] .pep-panel input[type="text"],
html[data-theme="dark"] .lc-toolbar select, html[data-theme="dark"] .lc-toolbar input[type="text"] { color: #dde7eb; background: #0e1c25; border-color: #2a3f4b; }
html[data-theme="dark"] .pep-panel select:disabled { color: #6b7f89; }
html[data-theme="dark"] .pep-editor .danger { color: #f87171; }

/* ChemStation box in the Open dialog: same look as the .RAW box, set apart by colour. */
.import-chem { margin-bottom: 12px; border-left: 4px solid #22c55e; }
.import-chem .import-raw-head { flex-wrap: wrap; gap: 10px; }

/* ---- retention-time strip above the spectrum (LC-MS runs only) ---- */
.lc-strip { padding: 8px 15px 6px; border-bottom: 1px solid rgba(255,255,255,.08); background: #0e1c25; color: #d8e4e7; font-size: 13px; }
.lc-strip-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 14px; align-items: baseline; }
.lc-strip-title b { color: #5eead4; }
.lc-strip .muted { color: #8496a0; font-size: 12px; }
.lc-strip-actions { display: inline-flex; gap: 12px; }
.lc-strip-actions .text-button { color: #5eead4; }
.lc-strip-plot svg { display: block; width: 100%; height: 70px; margin-top: 4px; cursor: crosshair; touch-action: none; user-select: none; }
.lc-strip-why { margin: 6px 0 2px; padding: 8px 10px; border-radius: 8px; background: rgba(20,184,166,.1); line-height: 1.5; font-size: 12.5px; }
/* A charge read from partners is a sentence, not a row of chips. */
.measure-chip.measure-method { display: block; max-width: 100%; line-height: 1.45; white-space: normal; }
.measure-chip.measure-method small { opacity: .8; }
.pep-otherpol { font-weight: 600; color: #f59e0b; font-size: 10.5px; }

/* ---- structures from ChemDraw / SMILES ---- */
.pep-struct-row { margin-top: 6px; }
.pep-struct-row #pepSmiles { flex: 1; min-width: 220px; }
.pep-drawing { margin: 10px 0; padding: 10px; border: 1px solid rgba(148,163,184,.35); border-radius: 10px; }
.pep-drawing-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; margin-bottom: 8px; }
.pep-drawing-head #pepDrawClose { margin-left: auto; }
.pep-drawing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.pep-drawn { padding: 8px; border: 1px solid rgba(148,163,184,.35); border-radius: 8px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pep-drawn.sel { border: 2px solid #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.15); }
.pep-drawn-img { cursor: zoom-in; border-radius: 6px; overflow: hidden; }
.pep-drawn-img svg, .pep-drawn-zoom svg { display: block; width: 100%; height: auto; }
.pep-drawn-seq { overflow-wrap: anywhere; font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; }
.pep-drawn-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.pep-drawn-zoom { margin-top: 10px; cursor: zoom-out; border-radius: 8px; overflow: hidden; border: 1px solid rgba(148,163,184,.35); position: relative; }
.pep-drawn-zoom svg { max-height: 62vh; }
.pep-match tr.pep-subcat td { padding-top: 12px; font-weight: 700; font-size: 12px; letter-spacing: .02em; text-transform: uppercase; opacity: .75; border-bottom: 1px solid rgba(148,163,184,.45); }
.pep-match tr.pep-single td { border-top: 2px solid rgba(148,163,184,.45); }
.pep-zoom-close { position: absolute; top: 8px; right: 8px; z-index: 1; }
.pep-links { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin: 6px 0; }
.pep-chip.link { border-left: 3px solid #d97706; }
.pep-link-add { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }

/* ---- prediction table: likelihood classes and compound groups ---- */
.pep-match tr.pep-cat td { font-weight: 700; font-size: 14px; padding: 10px 8px 6px; border-top: 2px solid rgba(148,163,184,.5); }
.pep-match tr.pep-cat.good td { color: #16a34a; }
.pep-match tr.pep-cat.warn td { color: #d97706; }
.pep-match tr.pep-cat.bad td { color: #dc2626; }
.pep-match tr.pep-grouphead td { background: rgba(148,163,184,.12); padding: 6px 10px; font-size: 13px; }
.pep-match tr.pep-ingroup > td:first-child { padding-left: 18px; }
html[data-theme="dark"] .pep-match tr.pep-cat.good td { color: #4ade80; }
html[data-theme="dark"] .pep-match tr.pep-cat.warn td { color: #fbbf24; }
html[data-theme="dark"] .pep-match tr.pep-cat.bad td { color: #f87171; }
/* Chromatogram zoom bar and the single-scan m/z readout. */
.lc-zoombar { padding-top: 0; }
.lc-mode { display: inline-flex; gap: 4px; }
.lc-zoombar .secondary-button.active { border-color: #6366f1; color: #4f46e5; background: rgba(99,102,241,.12); }
html[data-theme="dark"] .lc-zoombar .secondary-button.active { color: #c7d2fe; background: rgba(99,102,241,.22); }
.lc-svg.is-zoom { cursor: zoom-in; }
.lc-scan { margin: 8px 14px 0; padding: 8px 12px; border: 1px solid rgba(20,184,166,.35); border-radius: 8px; font-size: 13px; background: rgba(20,184,166,.07); }
.lc-scan-list { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-family: ui-monospace, monospace; }
