/* ============================================================
   Qualitative Analysis — drag & drop layer
   (sits alongside titration3.css, which supplies header/panels/etc.)
   ============================================================ */

.panel-hint {
  font-size: 10px; color: var(--muted, #777);
  line-height: 1.4; margin: 2px 2px 8px;
}

/* ── Reagent / tool shelf ─────────────────────────────────── */
.shelf-list {
  display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto;
}
.shelf-item {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none;
  padding: 5px 8px; gap: 6px;
  cursor: grab; user-select: none; touch-action: none;
  transition: opacity 0.15s;
}
.shelf-item:hover { opacity: 0.8; }
.shelf-item.dragging { opacity: 0.35; }
.shelf-item .icon { width: 24px; height: 26px; }
.shelf-item .icon svg { width: 24px; height: 26px; } /* overrides the inline 34x36 on the SVGs */
.shelf-item .name { font-size: 10px; }
.shelf-item.tool .icon { filter: saturate(0.85); }

/* ── Collapsible category groups (card style) ────────────── */
.shelf-group {
  background: #f7faf8;
  border-left: 3px solid var(--green, #45825D);
  border-radius: 8px;
  margin-bottom: 7px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: box-shadow 0.18s ease;
}
.shelf-group:hover { box-shadow: 0 3px 10px rgba(69,130,93,0.18); }
.shelf-group:last-child { margin-bottom: 0; }

.shelf-group-header {
  display: flex; align-items: center; gap: 7px;
  width: 100%; border: none;
  background: transparent;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 11px; font-weight: 700; color: var(--green, #45825D);
  text-transform: uppercase; letter-spacing: 0.04em;
  font-family: var(--font);
  transition: background 0.15s ease;
}
.shelf-group.open .shelf-group-header {
  background: rgba(69,130,93,0.10);
}
.shelf-group-header:hover { background: rgba(69,130,93,0.16); }

.shelf-group-chevron {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--green, #45825D); color: #fff;
  font-size: 8px; flex-shrink: 0;
  transition: transform 0.18s ease;
}
.shelf-group.open .shelf-group-chevron { transform: rotate(90deg); }

.shelf-group-body {
  display: flex; flex-direction: column; gap: 2px;
  max-height: 0; overflow: hidden;
  padding: 0 6px;
  transition: max-height 0.22s ease, padding 0.22s ease;
}
.shelf-group.open .shelf-group-body {
  max-height: 320px;
  padding: 2px 6px 8px;
}

/* items sit on a slightly lighter chip within the card */
.shelf-group .shelf-item {
  background: #fff;
  border-radius: 6px;
  padding: 5px 8px;
}
.shelf-group .shelf-item:hover { opacity: 1; background: #eef6f1; }

/* ── Draggable ghost (follows pointer) ───────────────────── */
.drag-ghost {
  position: fixed; top: 0; left: 0; z-index: 999;
  pointer-events: none;
  display: flex; align-items: center; gap: 6px;
  background: none; border: none;
  font-size: 11px; font-weight: 600; color: var(--text, #2c2c2c);
  transform: translate(-50%, -50%);
  transition: transform 0.18s ease-out;
}
.drag-ghost.over-canvas {
  transform: translate(-50%, -50%) scale(2.1);
  box-shadow: 0 8px 28px rgba(0,0,0,0.4);
}
.drag-ghost .icon { display: flex; align-items: center; }
.drag-ghost .icon svg { display: block; width: 26px; height: 28px; }

/* Highlight a tube when something is dragged over it */
.tube-drop-hint {
  position: absolute; pointer-events: none; z-index: 4;
  border: 2px dashed rgba(120,220,150,0.9); border-radius: 8px;
}

/* ── Tube picker (right panel quick reference) ───────────── */
.tube-picker { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.tube-picker-list { display: flex; flex-direction: column; gap: 5px; overflow-y: auto; }
.tube-picker-item {
  font-size: 10.5px; padding: 6px 8px; border-radius: 6px;
  background: #f7faf8; border-left: 3px solid var(--border, #e0e0e0);
  color: var(--text, #2c2c2c);
}
.tube-picker-item.filled { border-left-color: var(--green, #45825D); }
.tube-picker-item .tp-name { font-weight: 700; }
.tube-picker-item .tp-state { color: var(--muted, #777); }

/* ── Observation Notebook modal ──────────────────────────── */
.notebook-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center; z-index: 200;
}
.notebook-card {
  background: #fff; border-radius: 16px; padding: 1.75rem 2rem;
  max-width: 560px; width: 92%; max-height: 86vh; overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,0.28);
}
.notebook-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.notebook-header h2 { font-size: 19px; color: var(--green, #45825D); }
.notebook-sub { font-size: 12px; color: var(--muted, #777); margin-bottom: 14px; }
.notebook-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.notebook-form label { font-size: 11px; font-weight: 700; color: var(--text, #2c2c2c); display: flex; flex-direction: column; gap: 3px; }
.notebook-form select, .notebook-form textarea, .notebook-final-row input {
  font-family: var(--font); font-size: 12px; font-weight: 400;
  border: 1.5px solid var(--border, #e0e0e0); border-radius: 6px;
  padding: 6px 8px; resize: vertical;
}
.notebook-entries { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; max-height: 220px; overflow-y: auto; }
.notebook-entries .obs-entry { border-left-color: #2a6898; }
.notebook-entries .obs-entry .nb-tube { font-weight: 700; color: #2a6898; }
.notebook-final { border-top: 1.5px solid var(--border, #e0e0e0); padding-top: 12px; }
.notebook-final-row { display: flex; gap: 10px; margin-bottom: 10px; }
.notebook-final-row label { flex: 1; font-size: 11px; font-weight: 700; display: flex; flex-direction: column; gap: 3px; }
.final-feedback { margin-top: 10px; font-size: 12px; font-weight: 600; padding: 8px 10px; border-radius: 6px; display: none; }
.final-feedback.correct { display: block; background: #eaf5ef; color: var(--green, #45825D); }
.final-feedback.wrong   { display: block; background: #fdeceb; color: #a03a2a; }

.popup-close-btn {
  background: none; border: none; font-size: 16px; cursor: pointer;
  color: var(--muted, #777); width: 26px; height: 26px; border-radius: 50%;
}
.popup-close-btn:hover { background: #f0f0f0; }
/* ── Notebook entry edit/delete actions ──────────────────── */
.obs-entry { position: relative; }
.obs-entry.editing { border-left-color: #c98a2a; background: #fdf6ea; }
.entry-actions { display: flex; gap: 8px; margin-top: 4px; }
.entry-btn { font-size: 10px; font-weight: 700; background: none; border: none; cursor: pointer; padding: 2px 4px; border-radius: 4px; }
.entry-btn.edit { color: #2a6898; }
.entry-btn.edit:hover { background: #e8f0f7; }
.entry-btn.delete { color: #a03a2a; }
.entry-btn.delete:hover { background: #fdeceb; }

.notebook-form-actions { display: flex; gap: 8px; }
.cancel-edit-btn { background: #888; }
.cancel-edit-btn:hover { background: #666; }

.notebook-header-actions { display: flex; gap: 4px; align-items: center; }
.popup-icon-btn { background: none; border: none; font-size: 15px; cursor: pointer; color: #45825D; width: 26px; height: 26px; border-radius: 50%; }
.popup-icon-btn:hover { background: #ddd ; }

/* ── Delete confirmation popup ───────────────────────────── */
.confirm-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; z-index: 300; }
.confirm-card { background: #fff; border-radius: 14px; padding: 1.25rem 1.5rem; max-width: 320px; width: 88%; box-shadow: 0 8px 40px rgba(0,0,0,0.28); display: flex; flex-direction: column; gap: 14px; }
.confirm-card p { font-size: 13px; color: var(--text, #2c2c2c); margin: 0; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.confirm-btn { border: none; border-radius: 18px; padding: 7px 16px; font-size: 12px; font-weight: 600; cursor: pointer; }
.confirm-btn.cancel { background: #eee; color: var(--text, #2c2c2c); }
.confirm-btn.cancel:hover { background: #ddd; }
.confirm-btn.danger { background: #a03a2a; color: #fff; }
.confirm-btn.danger:hover { background: #82301f; }