/* One compact, shared note workspace in every context. */
.pgd-entity-notes{--en-line:#e7ded2;--en-line-strong:#d8c9b8;--en-muted:#7e7569;--en-accent:#9b5b12;--en-accent-soft:#fbf3e6;color:var(--text-primary,#302b25);font-size:13px;min-width:0;max-width:100%;container-type:inline-size}
.pgd-entity-notes [hidden]{display:none!important}
.pgd-entity-notes button,.pgd-entity-notes input,.pgd-entity-notes textarea,.pgd-entity-notes select{font:inherit}
.pgd-entity-notes button{cursor:pointer;box-shadow:none!important;transform:none!important}
.pgd-entity-notes button:focus-visible,.pgd-entity-notes textarea:focus-visible,.pgd-entity-notes select:focus-visible{outline:2px solid var(--en-accent);outline-offset:-3px;box-shadow:none!important}
.pgd-entity-notes__toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;margin-bottom:4px;border-bottom:1px solid var(--en-line)}
.pgd-entity-notes__tabs{display:flex;align-items:center;gap:0;min-width:0}
.pgd-entity-notes__tabs>button{position:relative;min-height:38px;padding:8px 10px 7px;border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;color:var(--en-muted);font-weight:650;white-space:nowrap}
.pgd-entity-notes__tabs>button[aria-selected=true]{border-bottom-color:var(--en-accent);background:transparent;color:var(--en-accent)}
.pgd-entity-notes__tabs span{margin-left:3px;color:inherit;font-size:10px;font-weight:500;font-variant-numeric:tabular-nums;opacity:.72}
.pgd-entity-notes__button{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:32px;padding:5px 9px;border:1px solid var(--en-line-strong);border-radius:7px;background:var(--surface,#fff);color:inherit;line-height:1.3;text-decoration:none}
.pgd-entity-notes__button:hover{border-color:#c7aa87;background:var(--en-accent-soft);color:var(--en-accent)}
.pgd-entity-notes__tabs>button:hover{background:var(--en-accent-soft);color:var(--en-accent)}
.pgd-entity-notes__button.is-icon{width:32px;flex:0 0 32px;padding:0;border-color:transparent;background:transparent}
.pgd-entity-notes__button.is-icon:hover{border-color:transparent;background:var(--en-accent-soft);color:var(--en-accent)}
.pgd-entity-notes__button.is-icon.is-danger:hover{background:#fff1ef;color:#a54036}
.pgd-entity-notes__button svg{width:16px;height:16px;flex:none}
.pgd-entity-notes__button.is-primary{background:var(--en-accent);border-color:var(--en-accent);color:#fff}
.pgd-entity-notes__button.is-danger{color:#a54036}
.pgd-entity-notes button:disabled{opacity:.5;cursor:wait}
.pgd-entity-notes__entry{border:0;border-bottom:1px solid var(--en-line);border-radius:0;padding:0;background:transparent;transition:background-color .15s ease}
.pgd-entity-notes__entry.is-expanded{background:#fbfaf7}
.pgd-entity-notes__line{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:4px}
.pgd-entity-notes .pgd-entity-notes__preview{display:flex;align-items:center;justify-content:flex-start;gap:0;width:100%;min-width:0;padding:9px 4px 9px 0;border:0;border-radius:0;background:transparent;text-align:left;white-space:nowrap}
.pgd-entity-notes .pgd-entity-notes__preview:hover{background:transparent;color:var(--en-accent)}
.pgd-entity-notes .pgd-entity-notes__preview::after{content:'›';flex:0 0 auto;margin-left:7px;color:#a49a8e;font-size:16px;line-height:1;transition:transform .15s ease}
.pgd-entity-notes .pgd-entity-notes__preview[aria-expanded=true]::after{transform:rotate(90deg)}
.pgd-entity-notes__meta{display:flex;align-items:center;flex:0 1 auto;min-width:0;color:var(--en-muted);font-size:11px;white-space:nowrap}
.pgd-entity-notes__meta time{flex:none;color:var(--text-primary,#302b25);font-size:11px;font-variant-numeric:tabular-nums}
.pgd-entity-notes__meta>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pgd-entity-notes__kind{font-weight:650}
.pgd-entity-notes__context{max-width:110px}
.pgd-entity-notes__meta>*+*::before,.pgd-entity-notes__excerpt::before{content:'›';display:inline-block;margin:0 7px;color:#b3a99d;font-weight:400}
.pgd-entity-notes__excerpt{display:block;flex:1 1 130px;min-width:64px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text-primary,#302b25);line-height:1.4;font-weight:400}
.pgd-entity-notes__entry.is-expanded .pgd-entity-notes__excerpt{display:none}
.pgd-entity-notes__actions{display:flex;align-items:center;gap:0}
.pgd-entity-notes__actions .pgd-entity-notes__button{color:#71685e}
.pgd-entity-notes__full{max-height:240px;margin:0 68px 8px 0;padding:9px 12px;overflow-y:auto;border-left:2px solid var(--en-accent);background:transparent;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6}
.pgd-entity-notes.is-editing [data-entity-list]{display:none}
.pgd-entity-notes__form{display:grid;gap:10px;margin:0;padding:12px 0 14px;border:0;border-bottom:1px solid var(--en-line);border-radius:0;background:transparent}
.pgd-entity-notes__form-head,.pgd-entity-notes__form-footer,.pgd-entity-notes__confirm,.pgd-entity-notes__paging{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.pgd-entity-notes__form-head span,.pgd-entity-notes__form-footer>span{font-size:11px;color:var(--en-muted);flex:1}
.pgd-entity-notes__form-head strong{font-size:14px}
.pgd-entity-notes__form-footer{justify-content:flex-end}
.pgd-entity-notes__form-footer>span{display:none}
.pgd-entity-notes__fields{display:flex;gap:8px;min-width:0}
.pgd-entity-notes__fields label{display:grid;gap:4px;font-size:11px;color:var(--en-muted);min-width:0;flex:1}
.pgd-entity-notes__fields label:first-child{flex:0 0 100px}
.pgd-entity-notes select{min-width:0;width:100%;height:34px;padding:4px 8px;border:1px solid var(--en-line);border-radius:8px;background:var(--surface,#fff);color:inherit;text-overflow:ellipsis}
.pgd-entity-notes__text-label{display:block;min-width:0}
.pgd-entity-notes textarea{display:block;width:100%;box-sizing:border-box;min-height:80px;max-height:280px;resize:vertical;padding:9px 10px;border:1px solid var(--en-line-strong);border-radius:8px;background:var(--surface,#fff);color:inherit;line-height:1.5;box-shadow:none}
.pgd-entity-notes__status{margin:6px 0 0;font-size:12px;color:#417166}
.pgd-entity-notes__status:empty{display:none}
.pgd-entity-notes__status.is-error{color:#a54036}
.pgd-entity-notes__empty{padding:16px 0;margin:0;font-size:12px;color:var(--en-muted)}
.pgd-entity-notes__confirm{padding:8px 0}
.pgd-entity-notes__confirm>span{flex:1;font-size:12px}
.pgd-entity-notes__paging{justify-content:flex-end;margin-top:8px;font-size:12px}
.pgd-entity-notes__sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.pgd-private-note-widget .pgd-private-note-btn{box-shadow:none!important;transform:none!important}
.pgd-private-note-widget .pgd-private-note-btn svg{display:block;width:16px;height:16px;flex:0 0 16px}
.pgd-private-note-widget .pgd-private-note-btn:focus-visible{outline:2px solid #63788b;outline-offset:-3px;box-shadow:none!important}
.pgd-private-note-dialog:has(.pgd-entity-notes){position:fixed;top:max(24px,calc(50dvh - 150px));right:0;bottom:auto;left:0;width:min(680px,calc(100vw - 24px));max-width:none;margin:0 auto}
.pgd-private-note-dialog:has(.pgd-entity-notes) .pgd-private-note-dialog__panel{min-width:0;max-height:calc(100dvh - 32px);padding:0;overflow-y:auto;border-color:#d9ccbd;border-radius:12px;background:var(--surface,#fff);box-shadow:0 18px 50px rgba(48,38,28,.16)}
.pgd-private-note-dialog:has(.pgd-entity-notes) .pgd-private-note-dialog__head{gap:4px;margin:0;padding:15px 54px 13px 18px;border-bottom:1px solid var(--en-line)}
.pgd-private-note-dialog:has(.pgd-entity-notes) .pgd-private-note-dialog__title{display:none}
.pgd-private-note-dialog:has(.pgd-entity-notes) .pgd-private-note-dialog__kicker{font-size:10px;letter-spacing:.045em}
.pgd-private-note-dialog:has(.pgd-entity-notes) .pgd-private-note-dialog__entity{margin:0;color:var(--text-primary,#302b25);font-size:16px;font-weight:800}
.pgd-private-note-dialog:has(.pgd-entity-notes) .pgd-private-note-dialog__help{display:none}
.pgd-private-note-dialog:has(.pgd-entity-notes) .pgd-private-note-dialog__close{top:11px;right:12px;width:32px;height:32px;border-color:var(--en-line-strong);border-radius:7px}
.pgd-private-note-dialog__close-label{display:none}
.pgd-private-note-dialog__close-icon{line-height:1}
.pgd-private-note-dialog:has(.pgd-entity-notes) .pgd-entity-notes{padding:0 18px 14px}
.pgd-private-note-dialog:has(.pgd-entity-notes) .pgd-entity-notes__toolbar{margin:0 -18px 3px;padding:0 18px;background:#fbfaf7}
.pgd-private-note-dialog:has(.pgd-entity-notes) [data-entity-add]{margin-bottom:0}
@media(max-width:760px),(pointer:coarse){
 .pgd-entity-notes__button,.pgd-entity-notes__tabs>button{min-height:40px}
 .pgd-private-note-widget.is-icon-only .pgd-private-note-btn{min-width:44px;min-height:44px}
 .pgd-entity-notes__button.is-icon{width:40px;flex-basis:40px}
 .pgd-entity-notes select,.pgd-entity-notes textarea{font-size:16px}
 .pgd-entity-notes select{height:44px}
 .pgd-private-note-dialog:has(.pgd-entity-notes){max-height:calc(100dvh - 16px)}
 .pgd-private-note-dialog:has(.pgd-entity-notes) .pgd-private-note-dialog__close{width:40px;height:40px}
}
@media(max-width:640px){
 .pgd-private-note-dialog:has(.pgd-entity-notes){inset:0;width:100%;height:100%;max-height:none;margin:0;transform:none}
}
@container(max-width:540px){
 .pgd-entity-notes__toolbar{gap:4px;flex-wrap:nowrap}
 .pgd-entity-notes__tabs{flex:1}
 .pgd-entity-notes__tabs>button{flex:1;min-width:0;padding-inline:4px;font-size:11px}
 .pgd-entity-notes__tabs span{margin-left:2px;font-size:10px}
 .pgd-entity-notes__add-label{display:none}
 .pgd-entity-notes [data-entity-add]{width:40px;flex:0 0 40px;padding:0;font-size:18px}
 .pgd-entity-notes__entry:not(.is-expanded) .pgd-entity-notes__actions{display:none}
 .pgd-entity-notes .pgd-entity-notes__preview{display:flex;gap:0;padding:8px 0}
 .pgd-entity-notes__meta{display:flex;gap:0;align-items:center}
 .pgd-entity-notes__meta time{flex:none}
 .pgd-entity-notes__context{max-width:58px}
 .pgd-entity-notes__meta>*+*::before,.pgd-entity-notes__excerpt::before{margin-inline:4px}
 .pgd-entity-notes__excerpt{flex-basis:60px;min-width:28px}
 .pgd-entity-notes .pgd-entity-notes__preview::after{margin-left:3px;font-size:14px}
 .pgd-entity-notes__full{margin-right:0;padding:8px 10px}
 .pgd-entity-notes__form-head span{flex-basis:100%}
}

/* Mobile entity notes are a full-screen workspace. The primary action is
   separated from the close control and always keeps its text label. */
@media(max-width:640px){
 .pgd-private-note-dialog:has(.pgd-entity-notes){inset:0;width:100%;height:100dvh;max-height:100dvh;margin:0;padding:0;background:var(--surface,#fffdf9)}
 .pgd-private-note-dialog:has(.pgd-entity-notes) .pgd-private-note-dialog__panel{display:flex;flex-direction:column;width:100%;height:100%;max-height:none;overflow:hidden;border:0;border-radius:0;box-shadow:none}
 .pgd-private-note-dialog:has(.pgd-entity-notes) .pgd-private-note-dialog__head{flex:0 0 auto;min-height:72px;padding:calc(14px + env(safe-area-inset-top,0px)) 104px 13px 16px}
 .pgd-private-note-dialog:has(.pgd-entity-notes) .pgd-private-note-dialog__kicker{font-size:11px;letter-spacing:.055em}
 .pgd-private-note-dialog:has(.pgd-entity-notes) .pgd-private-note-dialog__entity{margin-top:3px;font-size:clamp(18px,5.2vw,22px);line-height:1.12}
 .pgd-private-note-dialog:has(.pgd-entity-notes) .pgd-private-note-dialog__close{top:calc(10px + env(safe-area-inset-top,0px));right:12px;display:inline-flex;align-items:center;justify-content:center;gap:7px;width:auto;min-width:78px;height:42px;padding:0 11px;border-radius:8px;background:#fffaf2;color:#684214;font-size:13px;font-weight:750}
 .pgd-private-note-dialog:has(.pgd-entity-notes) .pgd-private-note-dialog__close-label{display:inline}
 .pgd-private-note-dialog:has(.pgd-entity-notes) .pgd-private-note-dialog__close-icon{font-size:18px}
 .pgd-private-note-dialog:has(.pgd-entity-notes) .pgd-entity-notes{display:flex;flex:1 1 auto;flex-direction:column;min-height:0;padding:0 14px calc(14px + env(safe-area-inset-bottom,0px))}
 .pgd-private-note-dialog:has(.pgd-entity-notes) .pgd-entity-notes__toolbar{display:grid;flex:0 0 auto;grid-template-columns:minmax(0,1fr);gap:9px;margin:0 -14px 4px;padding:8px 14px 11px;background:#fffdf9}
 .pgd-private-note-dialog:has(.pgd-entity-notes) .pgd-entity-notes__tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));width:100%;min-width:0;gap:3px}
 .pgd-private-note-dialog:has(.pgd-entity-notes) .pgd-entity-notes__tabs>button{min-width:0;min-height:44px;padding-inline:3px;font-size:12px}
 .pgd-private-note-dialog:has(.pgd-entity-notes) [data-entity-add]{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:44px;padding:0 14px;border-color:#9b5b12;border-radius:8px;background:#9b5b12;color:#fff;font-size:13px;font-weight:750;box-shadow:0 5px 14px rgba(122,70,8,.14)!important}
 .pgd-private-note-dialog:has(.pgd-entity-notes) [data-entity-add]:hover,.pgd-private-note-dialog:has(.pgd-entity-notes) [data-entity-add]:focus-visible{border-color:#7f480d;background:#7f480d;color:#fff}
 .pgd-private-note-dialog:has(.pgd-entity-notes) .pgd-entity-notes__add-label{display:inline}
 .pgd-private-note-dialog:has(.pgd-entity-notes) .pgd-entity-notes__add-icon{font-size:19px;line-height:1}
 .pgd-private-note-dialog:has(.pgd-entity-notes) [data-entity-list]{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain}
 .pgd-private-note-dialog:has(.pgd-entity-notes) .pgd-entity-notes__empty{padding:30px 6px;font-size:14px;line-height:1.55}
 .pgd-private-note-dialog:has(.pgd-entity-notes) .pgd-entity-notes__editor{flex:1 1 auto;min-height:0;overflow-y:auto;padding-top:12px}
 .pgd-private-note-dialog:has(.pgd-entity-notes) .pgd-entity-notes__textarea{min-height:clamp(160px,32dvh,280px)}
 .pgd-private-note-dialog:has(.pgd-entity-notes) .pgd-entity-notes__status{flex:0 0 auto}
}
