/* Term selection is shared by all note, letter and communication template editors. */
.term-picker-native[hidden],.term-picker-popup[hidden]{display:none!important}
.term-picker-trigger{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:44px;padding:11px 14px;border:1px solid var(--border,#d9e1e8);border-radius:9px;background:var(--sidebar,#fff);color:var(--ink,#26323f);font:inherit;text-align:left;box-shadow:0 1px 2px #22384a04;cursor:pointer}
.term-picker-trigger svg{width:18px;height:18px;flex:none;color:var(--muted,#647d95);transition:transform .15s}
.term-picker-trigger[aria-expanded=true]{border-color:var(--teal,#244f86);box-shadow:0 0 0 3px #5cb4bf1a}
.term-picker-trigger[aria-expanded=true] svg{transform:rotate(180deg)}
.term-picker-trigger:focus-visible,.term-picker-option:focus-visible{outline:2px solid var(--teal,#244f86);outline-offset:3px}
.term-picker-popup{position:fixed;z-index:1000;margin:0;padding:0;border:1px solid var(--border,#d9e1e8);border-radius:12px;background:var(--sidebar,#fff);color:var(--ink,#26323f);box-shadow:0 12px 38px #1d375b24;overflow:hidden;font-family:inherit}
.term-picker-search{display:flex;align-items:center;gap:10px;padding:12px 14px;border-bottom:1px solid var(--border,#d9e1e8)}
.term-picker-search svg{width:18px;height:18px;flex:none;color:var(--muted,#647d95)}
.term-picker-search input{width:100%;min-width:0;padding:0!important;border:0!important;box-shadow:none!important;border-radius:0;background:transparent!important;font:inherit;color:inherit;outline:none}
.term-picker-list{overflow-y:auto;overscroll-behavior:contain;padding:5px 6px}
.term-picker-group{padding:11px 10px 5px;color:var(--muted,#647d95);font-size:11px;font-weight:700;letter-spacing:.07em;text-transform:uppercase}
.term-picker-option{padding:9px 11px;border-radius:7px;cursor:pointer;display:flex;flex-direction:column;gap:2px;font-size:13px;line-height:1.4}
.term-picker-option small{font-size:11px;color:var(--muted,#647d95)}
.term-picker-popup .search-match,.search-results .search-match,[data-template-catalog-title] .search-match{padding:0;border-radius:2px;background:#dcf1f2;color:inherit;font-weight:750;box-shadow:0 1px 0 #63b4bc66}
.term-picker-option.is-active .search-match,.term-picker-option:hover .search-match{background:#cbe8ec}
@media(forced-colors:active){.term-picker-popup .search-match,.search-results .search-match,[data-template-catalog-title] .search-match{background:transparent;color:inherit;box-shadow:none;text-decoration:underline;font-weight:750}}
.term-picker-option:hover,.term-picker-option.is-active{background:var(--teal-light,#eef6f7);color:var(--teal,#244f86)}
.term-picker-option[aria-selected=true]{box-shadow:inset 3px 0 var(--teal,#244f86);background:var(--teal-light,#eef6f7)}
.term-picker-count{margin:0;padding:8px 14px;border-top:1px solid var(--border,#d9e1e8);font-size:11px;line-height:1.5;color:var(--muted,#647d95)}
.term-picker-editable{position:relative;width:100%}
.term-picker-editable>input{width:100%;padding-right:48px!important;margin-bottom:0!important}
.term-picker-editable-toggle{position:absolute;right:4px;top:4px;bottom:4px;width:38px;border:0;border-radius:6px;background:transparent;color:var(--muted,#647d95);cursor:pointer;display:grid;place-items:center}
.term-picker-editable-toggle svg{width:18px;height:18px;transition:transform .15s}
.term-picker-editable-toggle[aria-expanded=true] svg{transform:rotate(180deg)}
.term-picker-editable-toggle:hover{background:var(--teal-light,#eef6f7);color:var(--teal,#244f86)}
.term-picker-editable-toggle:focus-visible{outline:2px solid var(--teal,#244f86);outline-offset:1px}
.term-picker-editable-toggle:disabled{opacity:.5;cursor:not-allowed}
.note-title-context small{display:block;margin-top:7px;font-size:12px;font-weight:400;line-height:1.5}
.note-title-context{align-items:start}
.note-title-context>label{min-width:0}
.note-title-context label>.term-picker-editable{margin-top:7px}
.note-title-context .term-picker-editable>input,.note-title-context label>.term-picker-trigger{height:44px;min-height:44px;padding:10px 13px;font-size:12px;line-height:20px}
#note-title-settings-form textarea{width:100%;resize:vertical;min-height:170px;line-height:1.65}
.letter-appointment-context{margin:0 0 20px;padding:12px 14px;border:1px solid var(--border,#d9e1e8);border-radius:9px}
.letter-appointment-context summary,.contact-name-parts summary{cursor:pointer;color:var(--teal,#244f86);font-size:13px;font-weight:600}
.letter-appointment-context summary span{margin-left:8px;font-weight:400}
.letter-appointment-context label{display:block;margin-top:12px}
.contact-name-parts{margin-top:18px}
.template-catalog-search{display:block;max-width:460px;margin:18px 0}
.catalog-row[hidden]{display:none!important}

/* Reuse the same searchable picker for correspondence and note templates. */
.letter-template-field>.term-picker-trigger{height:42px;min-height:42px;padding:10px 14px}
.letter-template-controls>.term-picker-trigger{flex:1;min-width:0}
.term-picker-trigger>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.term-picker-trigger:disabled{cursor:not-allowed;opacity:.55}
.term-picker-trigger[aria-invalid=true]{border-color:var(--danger,#b54c4c)}
label>.term-picker-trigger{margin-top:7px}
.form-grid label>.term-picker-trigger{min-width:0}
.term-picker-compact,.rich-toolbar .term-picker-compact{width:auto;min-width:72px;max-width:145px;min-height:32px;padding:5px 8px;font-size:11px;gap:8px}
.rich-toolbar .term-picker-compact svg{width:14px;height:14px}
.rich-select-label>.term-picker-trigger{margin:0}
.theme-control>.term-picker-trigger{width:130px;min-height:36px;padding:7px 10px;font-size:12px;margin:0}
.dashboard-controls label>.term-picker-trigger{height:42px;min-height:42px;margin:0;font-size:12px}
.letter-history-filters .term-picker-trigger,.contact-log-filters .term-picker-trigger,.communication-log-filters .term-picker-trigger{margin-top:6px}
.term-picker-trigger{box-sizing:border-box}
.term-picker-popup{display:flex;flex-direction:column}
.term-picker-search,.term-picker-count{flex-shrink:0}
.term-picker-list{min-height:0;flex:1 1 auto}

.letter-layout-options{margin:0 0 18px;padding:10px 14px;border:1px solid var(--border);border-radius:9px}
.letter-layout-options summary{cursor:pointer;color:var(--teal);font-size:13px;font-weight:600}
.letter-layout-options .checkbox-row{margin:14px 0 8px}
.letter-layout-options p{margin:0 0 6px}
/* Account forms use the same light selection control rather than the primary action style. */
.auth-card .term-picker-trigger{justify-content:space-between;background:var(--sidebar,#fff);color:var(--ink,#26323f);border-color:var(--border,#d9e1e8);font-size:14px;font-weight:400;box-shadow:0 1px 2px #22384a04}
.auth-card .term-picker-trigger:hover,.auth-card .term-picker-trigger:active{background:var(--teal-light,#eef6f7);color:var(--ink,#26323f);border-color:var(--teal,#244f86)}
@media(prefers-reduced-motion:reduce){.term-picker-trigger svg{transition:none}}
.note-contact-setting-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:20px;margin-bottom:16px;padding-bottom:16px;border-bottom:1px solid var(--border,#e1e7ee)}
.note-contact-setting-row label{margin:0}.note-contact-setting-row .note-contact-available{display:flex;align-items:center;gap:10px;min-height:46px;padding:0 12px;border:1px solid var(--border,#e1e7ee);border-radius:8px;background:var(--surface,#fff);cursor:pointer}
.note-contact-available input[type=checkbox]{width:20px;height:20px;margin:0;flex:0 0 20px;accent-color:var(--primary,#28538c)}
@media(max-width:480px){.note-contact-setting-row{gap:12px;grid-template-columns:minmax(0,1fr)}.note-contact-setting-row .note-contact-available{justify-self:start}}

.term-picker-multi-option{flex-direction:row;align-items:center;gap:10px;min-height:40px}.term-picker-multi-marker{display:grid;place-items:center;width:18px;height:18px;flex:none;border:1px solid var(--border,#d9e1e8);border-radius:4px;font-size:13px;background:var(--sidebar,#fff)}.term-picker-multi-option[aria-selected=true] .term-picker-multi-marker{background:var(--teal,#244f86);border-color:var(--teal,#244f86);color:#fff}.term-picker-multi-footer{display:flex;justify-content:flex-end;padding:8px 12px;border-top:1px solid var(--border,#d9e1e8);flex-shrink:0}

/* Keep new-note actions inside the editor at narrow column widths. */
.note-action-bar .correspondence-action-controls{max-width:100%;min-width:0;flex:0 1 auto}

.term-picker-option.term-picker-mask-option{flex-direction:row;align-items:center;gap:10px}.term-picker-mask-photo{display:grid;place-items:center;flex:0 0 40px;width:40px;height:40px;background:var(--surface,#fff);border:1px solid var(--border,#d9e1e8);border-radius:7px;overflow:hidden;color:var(--muted)}.term-picker-mask-photo img{width:100%;height:100%;object-fit:contain;padding:2px}.term-picker-mask-photo svg{width:28px;height:28px}.term-picker-mask-copy{display:flex;flex-direction:column;gap:3px;min-width:0;overflow-wrap:anywhere}
.term-picker-trial-option{gap:6px;padding:11px}.trial-picker-identity{display:flex;align-items:start;justify-content:space-between;gap:12px}.trial-picker-identity>span:first-child{font-weight:650}.term-picker-trial-option[aria-disabled=true]{cursor:not-allowed;color:var(--muted,#647d95);background:transparent}.term-picker-trial-option[aria-disabled=true].is-active{background:var(--teal-light,#eef6f7);box-shadow:inset 2px 0 var(--muted,#647d95)}.term-picker-trial-option small{line-height:1.45}.term-picker-trial-option[aria-disabled=true] .trial-availability{opacity:1}
