/* Trade journal notes (js/s8-trade-note.js): the Position card's "Trade note" accordion on the replay
   and live sims, the owner's note card on /TradeReplay.php, and the Trading Metrics journal. Note text is
   always plain text (textContent); pre-wrap keeps the writer's line breaks. */

/* shared editor */
.tnote-ed{display:flex;flex-direction:column;gap:6px}
.tnote-ed textarea{display:block;width:100%;min-height:76px;max-height:260px;resize:vertical;padding:8px 10px;
  font:inherit;font-size:var(--s8-fs-sm,13px);line-height:1.45;color:var(--s8-fg);background:var(--s8-inset);
  border:1px solid var(--s8-line);border-radius:5px;box-sizing:border-box}
.tnote-ed textarea::placeholder{color:var(--s8-fg-4)}
.tnote-ed textarea:focus{outline:none;border-color:var(--s8-accent)}
.tnote-ed__foot{display:flex;align-items:center;gap:8px;font-size:var(--s8-fs-xs,11px);color:var(--s8-fg-3);min-height:16px}
.tnote-ed__status{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tnote-ed__status.is-err{color:var(--s8-down)}
.tnote-ed__count{font-variant-numeric:tabular-nums;color:var(--s8-fg-4)}
.tnote-ed__count.is-near{color:var(--s8-down)}
.tnote-ed__btns{display:flex;gap:6px;justify-content:flex-end}
.tnote-btn{font:inherit;font-size:var(--s8-fs-xs,12px);font-weight:600;padding:5px 12px;border-radius:5px;cursor:pointer;
  color:var(--s8-fg-2);background:transparent;border:1px solid var(--s8-line-2,var(--s8-line))}
.tnote-btn:hover{color:var(--s8-fg);background:var(--s8-hover)}
.tnote-btn--pr{color:#fff;background:var(--s8-accent);border-color:var(--s8-accent)}
.tnote-btn--pr:hover{color:#fff;background:var(--s8-accent);filter:brightness(1.08)}
.tnote-btn[disabled]{opacity:.5;cursor:default}

/* Position card accordion (same shell as Limit orders) */
.s8-tnote[hidden]{display:none}
.s8-tnote > summary{gap:8px}
.s8-tnote__peek{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right;
  font-size:var(--s8-fs-xs,11px);color:var(--s8-fg-3);font-weight:400;text-transform:none;letter-spacing:0}
.s8-tnote__peek.is-empty{color:var(--s8-fg-4)}

/* TradeReplay.php side panel card (head uses the page's .tr-sh/.tr-lb/.tr-hint) */
.tnote-trade{display:flex;flex-direction:column;gap:8px}
.tnote-trade .tnote-ed textarea{min-height:96px}

/* Trading Metrics journal */
.tnote-journal{padding:4px 16px 14px}
.tnote-list{display:flex;flex-direction:column}
.tnote-row{padding:12px 0;border-top:1px solid var(--s8-line)}
.tnote-row:first-child{border-top:0;padding-top:4px}
.tnote-row__head{display:flex;align-items:center;flex-wrap:wrap;gap:4px 10px;font-size:var(--s8-fs-sm,13px);font-variant-numeric:tabular-nums}
.tnote-row__tk{font-weight:700;color:var(--s8-fg)}
.tnote-row__meta{color:var(--s8-fg-3)}
.tnote-row__pnl{font-weight:600}
.tnote-row__pnl.up{color:var(--s8-up)}
.tnote-row__pnl.down{color:var(--s8-down)}
.tnote-row__acts{margin-left:auto;display:flex;gap:12px}
.tnote-row__acts a,.tnote-row__acts button{font:inherit;font-size:var(--s8-fs-xs,12px);font-weight:600;color:var(--s8-fg-3);
  background:none;border:0;padding:0;cursor:pointer;text-decoration:none}
.tnote-row__acts a:hover,.tnote-row__acts button:hover,.tnote-row__acts a:focus,.tnote-row__acts button:focus{color:var(--s8-fg);text-decoration:none}
.tnote-row__body{margin-top:6px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:var(--s8-fs-sm,13px);line-height:1.5;color:var(--s8-fg-2)}
.tnote-row .tnote-ed{margin-top:8px}
.tnote-empty{padding:18px 0 8px}
.tnote-empty b{display:block;font-size:18px;font-weight:600;color:var(--s8-fg-4)}
.tnote-empty span{display:block;margin-top:4px;font-size:var(--s8-fs-sm,13px);color:var(--s8-fg-3)}
.tnote-more{margin-top:10px}
