.customer-picker { position:relative; }
.customer-picker-field select { display:none; }
.customer-results { position:absolute; z-index:4; width:100%; max-height:280px; overflow-y:auto; margin-top:4px; padding:5px; background:#fff; border:1px solid #cfd5df; border-radius:9px; box-shadow:var(--shadow); }
.customer-result { display:flex; flex-direction:column; align-items:flex-start; width:100%; min-height:auto; padding:10px 12px; border:0; border-radius:6px; background:#fff; color:var(--ink); text-align:left; font-weight:400; }
.customer-result:hover,.customer-result.is-active { background:var(--brand-soft); color:var(--ink); }
.customer-result span { color:var(--muted); font-size:13px; }
.customer-search-status { min-height:20px; color:var(--muted); font-size:13px; margin:7px 0 0; }
.customer-selected { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 12px; border:1px solid #aabcfb; border-radius:8px; background:var(--brand-soft); }
.customer-selected-name { font-weight:700; }
.customer-clear { min-height:auto; padding:4px 8px; background:#fff; color:var(--brand-dark); border-color:#c7d7fe; font-size:12px; }
.quota-info { position:relative; display:inline-grid; place-items:center; width:17px; height:17px; min-height:17px; padding:0; border:1px solid #b8c2d1; border-radius:50%; background:#fff; color:var(--muted); font-size:11px; font-weight:800; line-height:1; cursor:help; }
.quota-info:hover,.quota-info:focus-visible { border-color:var(--brand); background:var(--brand-soft); color:var(--brand-dark); }
.quota-info::after { content:attr(data-tooltip); position:absolute; z-index:5; right:0; top:calc(100% + 8px); width:max-content; max-width:220px; padding:9px 10px; border:1px solid #c7d7fe; border-radius:8px; background:#172033; color:#fff; box-shadow:var(--shadow); font-size:12px; font-weight:500; line-height:1.4; text-align:left; white-space:normal; overflow-wrap:anywhere; opacity:0; visibility:hidden; transform:translateY(-3px); transition:opacity .15s,transform .15s,visibility .15s; pointer-events:none; }
.quota-info:hover::after,.quota-info:focus-visible::after { opacity:1; visibility:visible; transform:translateY(0); }

.markdown-editor { display:block; }
.markdown-editor .markdown-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:4px; margin-bottom:6px; padding:6px; border:1px solid #cfd5df; border-radius:8px 8px 0 0; background:#f8fafc; }
.markdown-editor .markdown-toolbar-btn { display:inline-flex; align-items:center; justify-content:center; min-height:30px; padding:3px 9px; border:1px solid transparent; border-radius:6px; background:transparent; color:var(--ink); font-size:13px; font-weight:700; cursor:pointer; }
.markdown-editor .markdown-toolbar-btn:hover { background:#fff; border-color:#c8ced8; }
.markdown-editor .markdown-toolbar-btn:focus-visible { outline:3px solid #c7d7fe; outline-offset:1px; }
.markdown-editor .markdown-toolbar-btn[disabled] { opacity:.45; cursor:not-allowed; }
.markdown-editor .markdown-toolbar-sep { width:1px; height:20px; margin:0 4px; background:#d7dce5; }
.markdown-editor .markdown-toolbar-spacer { flex:1; }
.markdown-editor .markdown-toolbar-preview { color:var(--brand-dark); border-color:#c7d7fe; background:#fff; }
.markdown-editor .markdown-toolbar-preview:hover { background:var(--brand-soft); }
.markdown-editor .markdown-source textarea, .markdown-editor .markdown-source input { border-radius:0 0 8px 8px; margin:0; }
.markdown-editor .markdown-source textarea { min-height:120px; }
.markdown-editor .markdown-preview { padding:14px 16px; border:1px solid #cfd5df; border-radius:0 0 8px 8px; background:#fbfcff; font-size:14px; line-height:1.6; }
.markdown-editor .markdown-preview p { margin:0 0 10px; }
.markdown-editor .markdown-preview p:last-child { margin-bottom:0; }
.markdown-editor .markdown-preview a { color:var(--brand-dark); }
.markdown-editor .markdown-preview del { color:var(--muted); }
.markdown-editor .markdown-preview .markdown-preview-error { margin:0; padding:10px 14px; border:1px solid #fecdca; border-left:4px solid var(--danger); border-radius:9px; background:#fef3f2; color:#7a271a; font-size:13px; }
.markdown-editor .markdown-helptext { margin-top:6px; }

.search-combo { display:flex; flex-direction:column; gap:12px; min-width:0; }
.search-combo input[type="search"] { flex:0 0 auto; }
.search-combo-results { flex:1 1 auto; min-width:0; min-height:0; max-width:100%; max-height:280px; overflow-y:auto; margin:0; padding:6px; border:1px solid #cfd5df; border-radius:9px; background:#fff; box-sizing:border-box; }
.search-combo-result { display:flex; flex-direction:column; align-items:flex-start; justify-content:flex-start; width:100%; max-width:100%; min-width:0; min-height:auto; margin:0; padding:10px 12px; border:0; border-radius:6px; background:#fff; color:var(--ink); text-align:left; font-weight:400; box-sizing:border-box; white-space:normal; overflow-wrap:anywhere; word-break:break-word; cursor:pointer; }
.search-combo-result + .search-combo-result { margin-top:2px; }
.search-combo-result:hover,.search-combo-result.is-active { background:var(--brand-soft); color:var(--ink); }
.search-combo-result strong { line-height:1.4; display:block; white-space:normal; overflow-wrap:anywhere; word-break:break-word; }
.search-combo-result small { color:var(--muted); font-size:13px; line-height:1.6; display:inline; white-space:normal; overflow-wrap:anywhere; word-break:break-word; }
.search-combo-result small .status { margin-left:6px; vertical-align:middle; }
#line-add-existing .search-combo-result,
#line-add-existing .search-combo-result strong,
#line-add-existing .search-combo-result small { white-space:normal !important; overflow-wrap:anywhere !important; word-break:break-word !important; }
.search-combo-status { min-height:20px; color:var(--muted); font-size:13px; margin:7px 0 0; }
.search-combo-selected { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 12px; border:1px solid #aabcfb; border-radius:8px; background:var(--brand-soft); }
.search-combo-selected > div { display:flex; flex-direction:column; gap:2px; min-width:0; }
.search-combo-selected strong { font-size:14px; line-height:1.4; }
.search-combo-selected small { color:var(--muted); font-size:13px; line-height:1.4; }
.search-combo-clear { min-height:auto; padding:4px 8px; background:#fff; color:var(--brand-dark); border-color:#c7d7fe; font-size:12px; }

.combobox { position:relative; }
.combobox .field { margin-bottom:0; }
.combobox-control { position:relative; }
.combobox-control input { padding-right:40px; }
.combobox-toggle { position:absolute; top:0; bottom:0; right:6px; margin:auto 0; display:inline-flex; align-items:center; justify-content:center; width:30px; height:30px; min-height:0; padding:0; border:1px solid transparent; border-radius:6px; background:transparent; color:var(--muted); cursor:pointer; }
.combobox-toggle:hover { background:var(--brand-soft); color:var(--brand-dark); border-color:#c7d7fe; }
.combobox-toggle:active { transform:none; }
.combobox-toggle .icon { width:18px; height:18px; transition:transform .15s ease; }
.combobox-toggle[aria-expanded="true"] .icon { transform:rotate(180deg); }
.combobox-results { position:absolute; z-index:5; left:0; right:0; top:calc(100% + 4px); max-height:220px; overflow-y:auto; padding:6px; border:1px solid #cfd5df; border-radius:9px; background:#fff; box-shadow:var(--shadow); }
.combobox-result { display:flex; align-items:center; justify-content:flex-start; width:100%; min-height:36px; margin:0; padding:8px 12px; border:0; border-radius:6px; background:#fff; color:var(--ink); text-align:left; font-weight:400; cursor:pointer; }
.combobox-result + .combobox-result { margin-top:2px; }
.combobox-result:hover,.combobox-result.is-active { background:var(--brand-soft); color:var(--ink); }
.combobox-result.combobox-new { flex-direction:column; align-items:flex-start; justify-content:center; gap:1px; padding-top:9px; padding-bottom:9px; border-bottom:1px solid var(--line); border-radius:6px 6px 0 0; margin-bottom:4px; }
.combobox-result.combobox-new strong { font-weight:600; text-align:left; }
.combobox-result.combobox-new small { color:var(--muted); font-size:12px; text-align:left; }
