.bh-internal-note-button {
    display:inline-flex;
    align-items:center;
    gap:5px;
    min-width:30px;
    min-height:30px;
    margin:0 2px;
    padding:4px 7px;
    border:1px solid transparent;
    border-radius:7px;
    background:transparent;
    color:var(--muted,#4d695b);
    font:inherit;
    vertical-align:middle;
    cursor:pointer;
}
.bh-internal-note-button:hover { background:var(--warning,#ffedbd); color:#9a6500; }
.bh-internal-note-button.has-notes { border-color:#dc982e; background:#fff4d7; color:#8a4e00; }
:root[data-theme="dark"] .bh-internal-note-button.has-notes { border-color:#a36f21; background:#3b2c16; color:#ffd48e; }
.bh-internal-note-button .bh-note-count { display:none; font-size:10px; font-weight:700; line-height:1; }
.bh-internal-note-button.has-notes .bh-note-count { display:inline; }
body.bh-notes-open { overflow:hidden; }
#bh-internal-notes-modal { box-sizing:border-box; width:calc(100% - 32px); max-width:680px; max-height:calc(100% - 32px); padding:0; border:1px solid var(--line,#c8d6cf); border-radius:14px; background:var(--surface,#fff); color:var(--text,#15382a); box-shadow:0 22px 70px #0008; }
#bh-internal-notes-modal:not([open]) { display:none; }
#bh-internal-notes-modal[open] { display:flex; flex-direction:column; }
#bh-internal-notes-modal::backdrop { background:rgba(0,0,0,.72); }
.bh-notes-header { display:flex; align-items:center; gap:12px; padding:16px 18px; border-bottom:1px solid var(--line,#c8d6cf); }
.bh-notes-header h2 { flex:1; margin:0; font-size:18px; }
.bh-notes-close { width:auto; min-height:36px; padding:7px 10px; border:1px solid var(--line,#c8d6cf); border-radius:8px; background:var(--subtle,#edf3f0); color:var(--text,#15382a); font:inherit; cursor:pointer; }
.bh-notes-body { min-height:0; padding:18px; overflow:auto; }
.bh-notes-reference { margin:0 0 16px; padding:12px 14px; border-left:4px solid var(--accent,#0b6b3d); border-radius:8px; background:var(--subtle,#edf3f0); color:var(--muted,#4d695b); font-size:12px; line-height:1.55; white-space:pre-wrap; overflow-wrap:anywhere; }
.bh-notes-list { display:grid; gap:10px; margin-bottom:18px; }
.bh-note-entry { padding:12px 14px; border:1px solid var(--line,#c8d6cf); border-radius:9px; background:var(--surface,#fff); }
.bh-note-entry-meta { margin-bottom:6px; color:var(--muted,#4d695b); font-size:11px; font-weight:700; }
.bh-note-entry-text { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.55; }
.bh-notes-empty, .bh-notes-status { margin:10px 0; color:var(--muted,#4d695b); font-size:13px; }
.bh-notes-form { padding-top:16px; border-top:1px solid var(--line,#c8d6cf); }
.bh-notes-form label { display:block; margin-bottom:7px; font-size:12px; font-weight:700; }
.bh-notes-form textarea { width:100%; min-height:110px; resize:vertical; }
.bh-notes-actions { display:flex; align-items:center; justify-content:flex-end; gap:12px; margin-top:10px; }
.bh-notes-save { width:auto; min-height:40px; padding:9px 18px; border:0; border-radius:8px; background:var(--accent,#0b6b3d); color:var(--page,#e8efeb); font:inherit; font-weight:700; cursor:pointer; }
.bh-notes-save:disabled { opacity:.55; cursor:wait; }
@media(max-width:520px) {
    #bh-internal-notes-modal { width:100%; max-height:100%; height:100%; border-radius:0; }
    .bh-notes-header, .bh-notes-body { padding:14px; }
}
