/* panels.css -- the six rail panels. #railPanels is an absolute overlay over
   the chart, the same technique the old #sidebar/#notesSidebar used and for
   the same reason: #shell keeps full width so the plot never re-renders when
   a panel opens. One panel open at a time (see js/rail.js). */

#railPanels {
  position: absolute; top: 0; bottom: 0; left: var(--w-rail);
  width: var(--w-panel); z-index: 35;
  background: var(--panel); border-right: 1px solid var(--border);
  box-shadow: 8px 0 28px rgba(0, 0, 0, 0.45);
  display: flex; flex-direction: column;
}
#railPanels[hidden] { display: none; }
.rail-panel { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.rail-panel[hidden] { display: none; }
.panel-title {
  flex: 0 0 auto; margin: 0; padding: var(--sp-4) var(--sp-4) var(--sp-3);
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.panel-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3);
}
.panel-note { margin: 0; font-size: var(--fs-sm); color: var(--muted); line-height: 1.5; }

/* Checklist and Notes each get a whole panel now, rather than sharing one at
   a fixed 80/20 split -- both are text-entry surfaces and the on-screen
   keyboard takes ~44% of the viewport. */
#checklistSection, #notesSection { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
#notesArea { flex: 1 1 auto; min-height: 160px; }

/* --- screener panel ------------------------------------------------------ */
.condition-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.condition-list label { display: flex; align-items: flex-start; gap: var(--sp-2); font-size: var(--fs-base); color: var(--text); line-height: 1.35; cursor: pointer; min-height: var(--tap); }
.condition-list input { margin-top: 2px; accent-color: var(--accent); }
.screen-btn {
  margin-top: var(--sp-2); width: 100%; padding: 0 var(--sp-3);
  font: inherit; font-size: var(--fs-base); font-weight: 600;
  color: var(--surface); background: var(--text);
  border: 1px solid var(--text); border-radius: var(--radius); cursor: pointer;
}
.screen-btn:disabled { opacity: 0.4; cursor: default; }
.screen-btn.dirty { background: var(--accent); border-color: var(--accent); }
.condition-hint { display: none; margin: var(--sp-2) 0 0; font-size: var(--fs-micro); color: var(--accent); line-height: 1.3; }
.condition-hint.visible { display: block; }
#basicSection { padding-bottom: var(--sp-3); border-bottom: 1px solid var(--border); }
#screenStatus { margin: 0; color: var(--muted); font-size: var(--fs-sm); }

/* --- watchlists panel -------------------------------------------------- */
#watchlistTopRow { display: flex; flex-direction: column; gap: var(--sp-2); }
#watchlistSelect { width: 100%; box-sizing: border-box; padding: 0 var(--sp-2); min-height: var(--tap); border: 1px solid var(--border); border-radius: var(--radius); font-size: var(--fs-base); background: var(--panel); color: var(--text); }
#watchlistActions { display: flex; gap: var(--sp-2); margin-top: var(--sp-2); }
.wl-btn {
  flex: 1 1 auto; padding: 0 var(--sp-1); font: inherit; font-size: var(--fs-sm); font-weight: 600;
  color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
}
.wl-btn:disabled { opacity: 0.4; cursor: default; }
.wl-btn.wl-confirm { background: var(--down); border-color: var(--down); color: var(--surface); }
.wl-inline-form { display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-2); }
.wl-inline-form.hidden, #watchlistBody.hidden { display: none; }
.wl-inline-form input[type="text"] {
  width: 100%; box-sizing: border-box; padding: 0 var(--sp-2); min-height: var(--tap); border: 1px solid var(--border); border-radius: var(--radius); font: inherit; font-size: var(--fs-base); background: var(--surface); color: var(--text);
}
.wl-inline-form-row { display: flex; gap: var(--sp-2); }
#watchlistBody { margin-top: var(--sp-3); }
#watchlistAddRow { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-3); }
#watchlistAddSearch { padding: 0 var(--sp-2); min-height: var(--tap); border: 1px solid var(--border); border-radius: var(--radius); font: inherit; font-size: var(--fs-base); background: var(--surface); color: var(--text); }
#watchlistAddSelect { width: 100%; box-sizing: border-box; padding: 0 var(--sp-2); min-height: var(--tap); border: 1px solid var(--border); border-radius: var(--radius); font-size: var(--fs-sm); background: var(--panel); color: var(--text); }
.wl-stock-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.wl-stock-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  padding: var(--sp-2); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.wl-stock-name { font-size: var(--fs-sm); color: var(--text); overflow-wrap: anywhere; }
.wl-stock-actions { display: flex; gap: var(--sp-1); flex: 0 0 auto; }
.wl-icon-btn {
  padding: 0 var(--sp-2); font: inherit; font-size: var(--fs-sm); font-weight: 600; line-height: 1.2;
  color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
}
.wl-icon-btn.wl-remove { color: var(--down); border-color: var(--down); }
.wl-empty-hint { font-size: var(--fs-sm); color: var(--muted); }

/* --- journal panel --------------------------------------------------- */
#btLogForm { display: flex; flex-direction: column; gap: var(--sp-2); }
#btLogForm .bt-log-row { display: flex; gap: var(--sp-2); align-items: center; }
#btLogForm select { padding: 0 var(--sp-2); min-height: var(--tap); border: 1px solid var(--border); border-radius: var(--radius); font: inherit; background: var(--panel); color: var(--text); }
#btRationale { width: 100%; box-sizing: border-box; min-height: 88px; resize: vertical; font: inherit; font-size: var(--fs-base); padding: var(--sp-2); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
#btSave { padding: 0 var(--sp-3); min-height: var(--tap); font: inherit; font-weight: 600; color: var(--surface); background: var(--text); border: none; border-radius: var(--radius); cursor: pointer; }
#btEntries { margin-top: var(--sp-2); }
.bt-entry { border-top: 1px dotted var(--border); padding: var(--sp-2) 0; font-size: var(--fs-sm); }
.bt-entry-head { display: flex; gap: var(--sp-2); align-items: center; }
.bt-badge { padding: 0 var(--sp-1); border-radius: 3px; font-size: var(--fs-micro); text-transform: uppercase; color: var(--surface); }
.bt-badge-buy { background: var(--up); }
.bt-badge-pass { background: var(--muted); }
.bt-badge-watch { background: var(--accent); }
.bt-entry-rationale { margin-top: 2px; }
.bt-entry-horizons { color: var(--muted); font-size: var(--fs-micro); margin-top: 2px; }
.bt-entry-del { margin-left: auto; cursor: pointer; color: var(--muted); font-size: var(--fs-micro); }

/* --- checklist panel ------------------------------------------------- */
#checklistBody {
  flex: 1 1 auto; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; gap: var(--sp-3); padding-right: var(--sp-1);
}
.cl-item { display: flex; align-items: flex-start; gap: var(--sp-2); font-size: var(--fs-base); line-height: 1.6; color: var(--text); }
/* Section headings from Checklist.txt (Basic, Fundamentals, ...). First one
   has no top margin -- the body's own gap handles it. */
.cl-group {
  margin-top: var(--sp-4); font-size: var(--fs-micro); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted);
}
.cl-group:first-child { margin-top: 0; }
.cl-check { margin-top: 4px; flex: 0 0 auto; accent-color: var(--accent); }
/* Positive check (`1.`) ticks green, negative (`1r.`, a bad sign) ticks red.
   Two classes to outweigh the `input[type="checkbox"]` base rule. */
.cl-check.cl-check--pos { accent-color: var(--up); }
.cl-check.cl-check--neg { accent-color: var(--down); }
.cl-text { flex: 1 1 auto; min-width: 0; }
.cl-blank {
  box-sizing: content-box; margin: 0 3px; padding: 1px var(--sp-1);
  border: 1px solid var(--border); border-radius: 3px; background: var(--surface);
  font: inherit; font-size: var(--fs-sm); color: var(--text);
  vertical-align: baseline; max-width: 100%;
}
.cl-blank:focus { outline: none; border-color: var(--accent); }
#checklistStatus { flex: 0 0 auto; margin-top: var(--sp-2); font-size: var(--fs-micro); color: var(--muted); min-height: 14px; }

/* --- notes panel --------------------------------------------------- */
#notesArea {
  width: 100%; box-sizing: border-box;
  resize: none; padding: var(--sp-2); border: 1px solid var(--border); border-radius: var(--radius);
  font: inherit; font-size: var(--fs-base); color: var(--text); line-height: 1.4; background: var(--surface);
}
#notesArea:disabled { color: var(--muted); }
#notesStatus { flex: 0 0 auto; margin-top: var(--sp-2); font-size: var(--fs-micro); color: var(--muted); min-height: 14px; }
