/* The document grows with the record; only the note history has a bounded scroll area. */
.customer-profile-layout,.customer-record-main,.opportunity-record-main{min-width:0;min-height:0;height:auto;max-height:none;overflow:visible;align-content:start}
.customer-record-main,.opportunity-record-main{display:flex;flex-direction:column;gap:24px}
.customer-record-main>.section-gap,.opportunity-record-main>.section-gap{margin-top:0}
.customer-record-main>.card,.opportunity-record-main>.card{flex-shrink:0}
.customer-notes .card-title{align-items:flex-start;margin-bottom:20px}
.customer-notes .card-title .info{font-size:13px;margin-top:6px}
.customer-notes textarea{min-height:90px;max-height:280px;resize:vertical;margin-top:8px}
.note-save-row{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:12px;margin-bottom:22px}
#note-message{font-size:13px;color:var(--ui-muted,#738092);flex:1;overflow-wrap:anywhere}
.notes-toolbar{display:flex;align-items:center;gap:12px;padding-top:20px;border-top:1px solid var(--ui-line,#e7ebf0)}
.notes-toolbar .search{flex:1;max-width:none;min-width:0}
.notes-toolbar label{display:flex;align-items:center;gap:10px;white-space:nowrap;font-size:12px;color:var(--ui-muted,#738092)}
.notes-toolbar select{margin:0;width:auto;max-width:180px;font-size:13px;min-height:44px}
.notes-results{max-height:440px;max-height:min(440px,55dvh);overflow-y:auto;overscroll-behavior-y:auto;scrollbar-gutter:stable;margin-top:12px;overflow-wrap:anywhere}
.notes-results:focus-visible{outline:2px solid var(--blue);outline-offset:4px;border-radius:4px}
.note-history-row{padding:18px 4px;border-bottom:1px solid var(--ui-line,#e7ebf0)}
.note-history-row:last-child{border-bottom:0}
.note-meta{display:flex;align-items:baseline;justify-content:space-between;gap:8px 18px;flex-wrap:wrap;font-size:12px}
.note-meta strong{font-size:13px;color:var(--ui-ink,#192331)}
.note-meta span,.note-history-row>small{color:var(--ui-muted,#738092)}
.note-history-row>p{white-space:pre-wrap;color:var(--ui-ink,#192331);font-size:14px;line-height:1.6;margin:8px 0}
.note-history-row>small{font-size:11px}
.notes-empty{padding:24px 0;font-size:14px}
.notes-footer{display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:12px;color:var(--ui-muted,#738092)}
.note-error{color:#bd3d4b;font-size:13px;margin-top:8px}
/* Keep tall customer edit forms and their Save/Back controls inside the viewport. */
#modal[open] #modal-content{display:flex;flex-direction:column;max-height:calc(100dvh - 32px);min-height:0}
#modal .modal-head,#modal .modal-foot{flex-shrink:0}
#modal .modal-body{min-height:0;overflow-y:auto;overscroll-behavior-y:auto}
@media(max-width:600px){.notes-toolbar{flex-wrap:wrap}.notes-toolbar .search{flex-basis:100%}.notes-toolbar label{margin-left:auto}.note-meta{flex-direction:column;gap:5px}.customer-notes{padding:20px}.customer-record-main,.opportunity-record-main{gap:18px}}
