/* Test notes (js/test-notes.js): a panel along the right of Lantern's window, over the reading area, so that a record
   stays in sight while a tester writes about it */
.tn-panel {
    position: fixed; z-index: 2147482400; top: 64px; right: 12px; bottom: 12px;
    width: 380px; max-width: calc(100vw - 24px); box-sizing: border-box;
    display: flex; flex-direction: column;
    border: 1px solid var(--border); border-radius: 12px;
    background: var(--surface, #fff); color: var(--text-primary);
    box-shadow: 0 12px 36px rgba(9, 24, 44, .22);
    font-size: 13px; line-height: 1.4;
}
.tn-panel[hidden] { display: none; }
.tn-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 10px; border-bottom: 1px solid var(--border); }
.tn-head h2 { font-size: 15px; margin: 0; flex: 1; }
.tn-close { border: 0; background: none; font-size: 18px; line-height: 1; padding: 4px 6px; border-radius: 6px; cursor: pointer; color: var(--text-secondary); }
.tn-close:hover, .tn-close:focus-visible { background: #f1f5f9; color: var(--text-primary); }
.tn-form { padding: 10px 14px 12px; border-bottom: 1px solid var(--border); display: grid; gap: 8px; }
.tn-kinds { display: flex; gap: 6px; flex-wrap: wrap; }
.tn-kinds label { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-size: 12.5px; }
.tn-kinds input { margin: 0; }
.tn-kinds label:has(input:checked) { border-color: var(--accent); background: var(--accent-bg); }
.tn-form textarea { width: 100%; box-sizing: border-box; min-height: 84px; resize: vertical; font: inherit; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; }
.tn-form textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.tn-where { color: var(--text-secondary); font-size: 11.5px; }
.tn-row { display: flex; align-items: center; gap: 8px; }
.tn-row .tn-where { flex: 1; }
.tn-btn { font: inherit; padding: 5px 12px; border-radius: 8px; border: 1px solid var(--border); background: #fff; cursor: pointer; }
.tn-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.tn-btn:disabled { opacity: .5; cursor: default; }
.tn-error { color: var(--danger-color); font-size: 12px; }
.tn-filter { display: flex; gap: 4px; padding: 8px 14px 6px; }
.tn-filter button { font: inherit; font-size: 12px; padding: 2px 9px; border-radius: 999px; border: 1px solid transparent; background: none; cursor: pointer; color: var(--text-secondary); }
.tn-filter button[aria-pressed="true"] { border-color: var(--border); background: #f1f5f9; color: var(--text-primary); }
.tn-list { flex: 1; overflow-y: auto; padding: 2px 14px 12px; margin: 0; list-style: none; }
.tn-item { padding: 9px 0 10px; border-bottom: 1px solid var(--border); }
.tn-item:last-child { border-bottom: 0; }
.tn-item.withdrawn .tn-text { text-decoration: line-through; color: var(--text-secondary); }
.tn-top { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.tn-n { font-weight: 700; font-variant-numeric: tabular-nums; }
.tn-chip { font-size: 10.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; background: #f1f5f9; color: var(--text-secondary); }
.tn-chip.bug { background: #fdecec; color: #a4161a; }
.tn-chip.inconsistency { background: #fff4e0; color: #8a5300; }
.tn-chip.idea { background: #e8f1fd; color: #1d4f91; }
.tn-chip.fixed { background: #e6f6ec; color: #17663a; }
.tn-text { margin: 4px 0 3px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tn-meta { color: var(--text-secondary); font-size: 11.5px; }
.tn-reply { margin-top: 5px; padding: 5px 8px; border-left: 3px solid var(--accent); background: #f8fafc; font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tn-actions { display: flex; gap: 10px; margin-top: 4px; }
.tn-actions button { font: inherit; font-size: 12px; border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; }
.tn-empty { color: var(--text-secondary); padding: 14px 0; }
/* The thread under a note (build 630+): IMA's replies and the writer's, and the form that adds to it */
.tn-thread { display: grid; gap: 4px; margin-top: 5px; }
.tn-reply.tester { border-left-color: #94a3b8; }
.tn-reply-who { color: var(--text-secondary); font-size: 11px; margin-bottom: 1px; }
.tn-reply-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.tn-actions .tn-open-form[aria-expanded="true"] { font-weight: 600; }
.tn-reply-form { display: grid; gap: 6px; margin-top: 6px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: #f8fafc; }
.tn-reply-form textarea { width: 100%; box-sizing: border-box; min-height: 56px; resize: vertical; font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; }
.tn-reply-form textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.tn-review-row { display: flex; gap: 6px; }
.tn-review-row select, .tn-review-row input { font: inherit; font-size: 12.5px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.tn-review-row select { flex: 1; min-width: 0; }
.tn-review-row input { width: 110px; }
/* What the reader has not seen yet (build 646): such notes come first and open, marked along their left; a fresh reply
   or status says New. Notes with nothing new are folded to their first line, and open on a click */
.tn-item.tn-unread { border-left: 3px solid var(--accent); margin-left: -14px; padding-left: 11px; background: linear-gradient(90deg, #eef4ff, transparent 60%); }
.tn-new { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 5px; border-radius: 4px; background: var(--accent); color: #fff; }
.tn-reply.fresh { border-left-color: #f59e0b; background: #fffbeb; }
.tn-fold { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; width: 100%; border: 0; background: none; padding: 0; font: inherit; text-align: left; color: inherit; cursor: pointer; }
.tn-fold:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.tn-fold .tn-chevron { color: var(--text-secondary); font-size: 10px; width: 10px; }
.tn-item.tn-folded { padding: 6px 0 7px; }
.tn-item.tn-folded .tn-text { margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-secondary); }
.tn-filter { align-items: center; }
.tn-filter .tn-mark-all { margin-left: auto; color: var(--accent); }
