/* =====================================================================
   SortedDropdown (redesign) - pixel-perfect match of
   /sorted_dropdown_redesign.html Scenario 1.
   All rules are scoped to .ksd so nothing leaks to other widgets.
   Colors come from the existing Kohezion palette in core/ui/ui.css.
   ===================================================================== */

.ksd {
	box-sizing: border-box;
	padding: 12px;
	background: #FFFFFF;
	font-family: inherit;
	font-size: 12px;
	line-height: 1.4;
	color: #0B3764;
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	overflow: hidden;
}
.ksd *, .ksd *::before, .ksd *::after { box-sizing: border-box; }

/* Two panes + button column */
.ksd-grid {
	display: grid;
	grid-template-columns: 1fr 56px 1fr;
	gap: 0;
	flex: 1 1 auto;
	min-height: 0;
}

.ksd-pane {
	display: flex;
	flex-direction: column;
	border: 1px solid #DEE0E3;
	border-radius: 8px;
	background: #FFFFFF;
	overflow: hidden;
	min-height: 0;
	container-type: inline-size;
	transition: border-color 180ms cubic-bezier(0.4, 0, 0.2, 1),
				box-shadow 180ms cubic-bezier(0.4, 0, 0.2, 1);
}
.ksd-pane.drop-target {
	border-color: #249EF5;
	box-shadow: 0 0 0 3px rgba(36, 158, 245, 0.12);
}

.ksd-pane-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 12px;
	border-bottom: 1px solid #DEE0E3;
	background: #FAFBFD;
	gap: 8px;
	flex-shrink: 0;
}
.ksd-pane-title-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 8px; }
.ksd-pane-title {
	font-size: 11px;
	font-weight: 700;
	color: #0B3764;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
}
.ksd-count-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 18px;
	padding: 0 6px;
	background: #EBF2F8;
	color: #0B3764;
	font-size: 11px;
	font-weight: 600;
	border-radius: 999px;
	flex-shrink: 0;
}
.ksd-header-actions { display: flex; gap: 2px; flex-shrink: 0; }

.ksd-mini-btn {
	width: 26px;
	height: 26px;
	border: 1px solid transparent;
	background: transparent;
	color: #8C9BB5;
	border-radius: 4px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	flex-shrink: 0;
	transition: all 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Progressive icon hiding from rightmost when the pane is very narrow.
 * Each pane is its own container; the count badge always stays visible. */
@container (max-width: 175px) {
	.ksd-pane-header > .ksd-header-actions > *:nth-last-child(-n+1) { display: none; }
}
@container (max-width: 145px) {
	.ksd-pane-header > .ksd-header-actions > *:nth-last-child(-n+2) { display: none; }
}
@container (max-width: 115px) {
	.ksd-pane-header > .ksd-header-actions > *:nth-last-child(-n+3) { display: none; }
}
@container (max-width: 85px) {
	.ksd-pane-header > .ksd-header-actions > *:nth-last-child(-n+4) { display: none; }
}
.ksd-mini-btn:hover:not(:disabled) { background: #e0e0e0; color: #0B3764; }
.ksd-mini-btn:disabled { opacity: 0.35; cursor: not-allowed; }
/* Active state uses the app's standard pill-gray instead of solid brand blue. */
.ksd-mini-btn.active { background: #d6d6d6; color: #0B3764; }
.ksd-mini-btn.active:hover { background: #c8c8c8; color: #0B3764; }
.ksd-mini-btn svg { width: 14px; height: 14px; display: block; fill: currentColor; }

.ksd-search {
	position: relative;
	padding: 8px 10px;
	border-bottom: 1px solid #DEE0E3;
	flex-shrink: 0;
	display: none;
}
.ksd-pane.search-open .ksd-search { display: block; }
.ksd-search input {
	width: 100%;
	height: 28px;
	padding: 0 26px 0 30px;
	border: 1px solid #DEE0E3;
	border-radius: 4px;
	font-family: inherit;
	font-size: 12px;
	color: #0B3764;
	background: #FFFFFF;
	transition: border-color 180ms, box-shadow 180ms;
	outline: none;
}
.ksd-search input:focus {
	border-color: #249EF5;
	box-shadow: 0 0 0 3px rgba(36, 158, 245, 0.15);
}
.ksd-search-icon {
	position: absolute;
	left: 20px;
	top: 50%;
	transform: translateY(-50%);
	color: #A0AEC0;
	pointer-events: none;
	width: 14px;
	height: 14px;
	fill: currentColor;
}
.ksd-clear {
	position: absolute;
	right: 18px;
	top: 50%;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	border: none;
	background: #DEE0E3;
	color: #0B3764;
	border-radius: 50%;
	cursor: pointer;
	display: none;
	align-items: center;
	justify-content: center;
	font-size: 10px;
	font-weight: 700;
	padding: 0;
	line-height: 1;
}
.ksd-clear.visible { display: inline-flex; }
.ksd-clear:hover { background: #A0AEC0; color: #FFFFFF; }

.ksd-list {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 4px;
	min-height: 0;
	outline: none;
}
.ksd-list:focus-visible { outline: 2px solid #249EF5; outline-offset: -2px; }

.ksd-empty {
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
	color: #A0AEC0;
	font-size: 13px;
	padding: 24px;
	text-align: center;
	gap: 8px;
}
.ksd-empty.visible { display: flex; }
.ksd-empty svg { opacity: 0.5; width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.ksd-empty strong { color: #8C9BB5; font-weight: 600; }

.ksd-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	border-radius: 4px;
	cursor: pointer;
	user-select: none;
	transition: background 180ms;
	position: relative;
}
.ksd-item:hover { background: #EBF2F8; }
.ksd-item.selected { background: rgba(36, 158, 245, 0.12); color: #0B3764; }
.ksd-item.selected::before {
	content: "";
	position: absolute;
	left: 0;
	top: 6px;
	bottom: 6px;
	width: 3px;
	background: #249EF5;
	border-radius: 2px;
}
.ksd-item.just-moved { animation: ksd-just-moved 1.2s ease-out; }
@keyframes ksd-just-moved {
	0%   { background: rgba(52, 199, 89, 0.22); }
	100% { background: transparent; }
}
.ksd-item[draggable="true"] { cursor: grab; }
/* Source row during drag: show dashed placeholder, hide children.
   Crucially we must NOT use display:none (aborts drag) nor pointer-events:none
   (kills HTML5 drag events). */
.ksd-item.dragging {
	background: #FAFBFD !important;
	border: 1px dashed #B3D9FC;
	border-radius: 4px;
	cursor: grabbing;
}
.ksd-item.dragging > * { visibility: hidden; }
.ksd-item.dragging::before { display: none; }

.ksd-drag-handle {
	color: #A0AEC0;
	font-size: 11px;
	line-height: 1;
	letter-spacing: -2px;
	cursor: grab;
	padding-right: 2px;
	user-select: none;
	opacity: 0.6;
	font-weight: 700;
}
.ksd-item:hover .ksd-drag-handle { opacity: 1; }

.ksd-drop-line {
	height: 2px;
	background: #249EF5;
	margin: -1px 4px;
	border-radius: 2px;
	pointer-events: none;
	box-shadow: 0 0 6px rgba(36, 158, 245, 0.5);
}

/* Kohezion colour-status dot - shared across controls (do NOT duplicate).
   .ksd-status-dot : sorted_list rows + chips (sorted_dropdown.js)
   .k-cd-dot       : Select2 colour-coded dropdowns (dropdown.js)
   Colour comes from inline `style="background: #<hex>"` on the element;
   this rule only owns the structural styling (size, ring, halo). */
.ksd-status-dot,
.k-cd-dot {
	display: inline-block;
	flex-shrink: 0;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	border: 2px solid #FFFFFF;
	box-shadow: 0 0 0 1px rgba(11, 55, 100, 0.15);
	box-sizing: border-box;
}
.ksd-name-wrap { flex: 1; min-width: 0; }
.ksd-name {
	font-weight: 500;
	color: #0B3764;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	display: block;
}
.ksd-item mark {
	background: rgba(255, 149, 0, 0.25);
	color: #0B3764;
	padding: 0 1px;
	border-radius: 2px;
	font-weight: 600;
}

/* Middle button column */
.ksd-buttons {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 0 8px;
}
.ksd-icon-btn {
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid #DEE0E3;
	background: #FFFFFF;
	color: #8C9BB5;
	border-radius: 4px;
	cursor: pointer;
	transition: all 180ms cubic-bezier(0.4, 0, 0.2, 1);
	padding: 0;
	font-family: inherit;
}
.ksd-icon-btn svg { width: 14px; height: 14px; display: block; fill: currentColor; }
.ksd-icon-btn:hover:not(:disabled) { background: #EBF2F8; border-color: #B3D9FC; color: #0B3764; }
.ksd-icon-btn:active:not(:disabled) { background: #B3D9FC; }
.ksd-icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
/* The "Add" button used to be a solid blue primary; toned down to match the
   other icon buttons so the button column doesn't visually dominate. */
.ksd-icon-btn.primary { background: #FFFFFF; border-color: #DEE0E3; color: #8C9BB5; }
.ksd-icon-btn.primary:hover:not(:disabled) { background: #EBF2F8; border-color: #B3D9FC; color: #0B3764; }
.ksd-icon-btn.primary:active:not(:disabled) { background: #B3D9FC; }
.ksd-icon-btn.primary:disabled { opacity: 0.4; background: #FFFFFF; border-color: #DEE0E3; color: #DEE0E3; }
.ksd-spacer-8 { height: 8px; }

/* Footer row: progress + chips (help button moved to header). */
.ksd-footer {
	margin-top: 16px;
	display: grid;
	grid-template-columns: 240px 1fr;
	gap: 20px;
	align-items: center;
	flex-shrink: 0;
}
.ksd-footer.no-progress { grid-template-columns: 1fr; }

.ksd-progress { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ksd-progress-label {
	font-size: 12px;
	color: #8C9BB5;
	display: flex;
	justify-content: space-between;
}
.ksd-progress-label strong { color: #0B3764; font-weight: 600; }
.ksd-progress-bar { height: 6px; background: #EBF2F8; border-radius: 3px; overflow: hidden; }
.ksd-progress-fill {
	height: 100%;
	background: #249EF5;
	border-radius: 3px;
	transition: width 180ms, background 180ms;
	width: 0%;
}
.ksd-progress-fill.warning { background: #FF9500; }
.ksd-progress-fill.full { background: #34C759; }

.ksd-chip-preview {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 10px;
	background: #FAFBFD;
	border: 1px dashed #DEE0E3;
	border-radius: 8px;
	min-height: 40px;
	max-height: 80px;
	overflow-y: auto;
	align-items: center;
}
.ksd-chip-preview.drop-target { background: rgba(36, 158, 245, 0.06); border-color: #249EF5; }
.ksd-chip-preview-label {
	font-size: 12px;
	color: #A0AEC0;
	font-style: italic;
}
/* Match the "Edit Search" window pill style:
 * see getBubbleValues() in kohezion_core/documents/ui/fields/utils.js
 * and .pillBorderRadius in stylesheets/styles_k.css
 * (bg #e0e0e0, 1px border, 5px radius, 1px 10px padding, 22px line-height). */
.ksd-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 1px 10px;
	background: #e0e0e0;
	border: 1px solid #e0e0e0;
	border-radius: 5px;
	font-size: 12px;
	font-weight: 400;
	color: #0B3764;
	line-height: 22px;
	animation: ksd-chip-in 220ms ease-out;
	cursor: grab;
	transition: background 180ms, border-color 180ms;
	user-select: none;
}
@keyframes ksd-chip-in {
	from { transform: scale(0.9); opacity: 0; }
	to   { transform: scale(1); opacity: 1; }
}
.ksd-chip:hover { background: #d6d6d6; border-color: #d6d6d6; }
.ksd-chip.dragging {
	background: #FAFBFD !important;
	border-style: dashed !important;
	border-color: #B3D9FC !important;
	color: transparent !important;
	cursor: grabbing;
}
.ksd-chip.dragging > * { visibility: hidden; }

.ksd-chip-remove {
	border: none;
	background: transparent;
	width: 16px;
	height: 16px;
	margin-left: 2px;
	margin-right: -4px;
	border-radius: 50%;
	cursor: pointer;
	color: #8C9BB5;
	font-size: 14px;
	line-height: 1;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: inherit;
	font-weight: 700;
	transition: background 120ms, color 120ms;
}
.ksd-chip-remove:hover { background: rgba(11, 55, 100, 0.08); color: #FF3B30; }
.ksd-chip-drop-line {
	width: 2px;
	height: 22px;
	background: #249EF5;
	border-radius: 2px;
	pointer-events: none;
	box-shadow: 0 0 6px rgba(36, 158, 245, 0.5);
	align-self: center;
	margin: 0 -3px;
}

/* Drag ghost - floating shadow object following the cursor */
.ksd-drag-ghost {
	position: fixed;
	pointer-events: none;
	z-index: 10000;
	background: #FFFFFF;
	border: 1px solid #249EF5;
	border-radius: 8px;
	padding: 8px 12px;
	box-shadow: 0 12px 28px rgba(11, 55, 100, 0.24), 0 4px 8px rgba(11, 55, 100, 0.12);
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	color: #0B3764;
	min-width: 180px;
	max-width: 300px;
	transform: translate(-50%, -50%) rotate(-1.5deg);
	opacity: 0.95;
}
.ksd-ghost-count {
	background: #249EF5;
	color: #FFFFFF;
	border-radius: 999px;
	padding: 1px 8px;
	font-size: 11px;
	font-weight: 700;
	margin-left: auto;
}

/* Help (?) icon - lives in the Available pane header alongside sort/select-all.
   Matches the header mini-button style; popover uses position:fixed so it
   isn't clipped by the widget's overflow:hidden container. Position is
   calculated at open time from the button's bounding rect. */
.ksd-help { position: relative; display: inline-flex; align-items: center; }
.ksd-help-btn {
	font-family: inherit;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
}
.ksd-help-popover {
	position: fixed;
	top: 0;
	left: 0;
	width: 280px;
	/* Portaled to document.body, so the .ksd box-sizing rule doesn't reach it.
	   Pin it explicitly so width: 280px is the outer box, not the content box. */
	box-sizing: border-box;
	background: #0B3764;
	color: #FFFFFF;
	padding: 14px 14px 12px;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(11, 55, 100, 0.12);
	opacity: 0;
	pointer-events: none;
	transform: translateY(-4px);
	transition: opacity 180ms, transform 180ms;
	z-index: 10002;
	font-family: inherit;
	font-size: 12px;
	line-height: 1.4;
}
.ksd-help-popover.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.ksd-help-popover::before {
	content: "";
	position: absolute;
	top: -6px;
	right: 10px;
	width: 12px;
	height: 12px;
	background: #0B3764;
	transform: rotate(45deg);
}
.ksd-help-title {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-weight: 700;
	opacity: 0.7;
	margin-bottom: 8px;
}
.ksd-help-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 4px 0;
	font-size: 12px;
}
.ksd-help-row + .ksd-help-row { border-top: 1px solid rgba(255, 255, 255, 0.12); }
.ksd-help-keys { display: inline-flex; gap: 3px; flex-shrink: 0; }
.ksd-help-keys kbd {
	display: inline-block;
	padding: 1px 6px;
	background: rgba(255, 255, 255, 0.16);
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-bottom-width: 2px;
	border-radius: 3px;
	font-family: inherit;
	font-size: 10.5px;
	color: #FFFFFF;
	font-weight: 600;
}

/* No-color mode: hide status dots entirely */
.ksd.no-colors .ksd-status-dot { display: none; }

/* Sorted-selection mode (m_sorted === true): the Selected list is auto-sorted
   alphabetically, so manual reorder controls are meaningless. Hide the up/down
   buttons, their spacer, and the drag handle on selected items. Drag between
   the two lists (add/remove) is still available. */
.ksd.sorted .ksd-buttons > :nth-child(5),
.ksd.sorted .ksd-buttons > :nth-child(6),
.ksd.sorted .ksd-buttons > :nth-child(7) { display: none; }
.ksd.sorted [data-side="s"] .ksd-drag-handle { display: none; }

/* =========================================================================
   Responsive compact tiers: the widget restructures itself at smaller heights
   rather than clipping, so it stays fully usable inline (Builder) as well as
   in large dialogs. JS toggles `.compact` and `.tight` based on height.
   =========================================================================
   Tier 1 - `.compact`  (approx 220-360px tall):
	   hide chip preview + progress bar; keep all 6 action buttons.
   Tier 2 - `.tight`    (below ~220px tall):
	   also drop up/down/spacer so only the 4 add/remove buttons remain,
	   shrink them, and tighten gaps so the column fits in the grid row. */

/* Chip preview is HIDDEN by default. It's only shown when the widget is
   explicitly configured to show it - either via the per-field "Show Selection
   Preview" property, or forced by the View-Fields selector helpers. Previously
   the default was visible and `.compact` hid it at small heights, which meant
   the property was silently ignored above the compact threshold. */
.ksd-chip-preview { display: none; }
.ksd.always-show-chips .ksd-chip-preview { display: flex; }

/* Progress bar still hides in compact mode to save vertical space. */
.ksd.compact .ksd-progress { display: none; }
.ksd.compact .ksd-footer {
	margin-top: 8px;
	grid-template-columns: 1fr !important;
	gap: 8px;
	min-height: 0;
}
.ksd.compact .ksd-icon-btn { height: 30px; }
.ksd.compact .ksd-buttons { gap: 4px; padding: 0 6px; }

.ksd.tight .ksd-buttons { gap: 3px; padding: 0 4px; }
.ksd.tight .ksd-icon-btn { height: 26px; }
/* Hide the spacer + up/down buttons (children 5, 6, 7) at tight tier.
   Move-up / move-down are less essential inline; the lists still scroll. */
.ksd.tight .ksd-buttons > :nth-child(5),
.ksd.tight .ksd-buttons > :nth-child(6),
.ksd.tight .ksd-buttons > :nth-child(7) { display: none; }
/* Collapse the footer entirely at tight tier (help button shown but optional). */
.ksd.tight .ksd-footer { margin-top: 4px; }
.ksd.tight .ksd-help-btn { width: 22px; height: 22px; font-size: 11px; }

/* Headers shrink a touch in both compact and tight so the grid gets more room. */
.ksd.compact .ksd-pane-header { padding: 6px 10px; }
.ksd.tight .ksd-pane-header { padding: 4px 8px; }
.ksd.tight .ksd-pane-title { font-size: 10px; letter-spacing: 0.04em; }

/* Focus ring */
.ksd :focus-visible { outline: 2px solid #249EF5; outline-offset: 2px; }

/* Toast singleton (portaled to document.body by SortedDropdown.showToast).
   Outside .ksd scope on purpose - it lives on <body>, not inside the widget. */
#ksd-toast-singleton {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%) translateY(80px);
	background: #0B3764;
	color: #FFFFFF;
	padding: 10px 16px;
	border-radius: 999px;
	font-size: 13px;
	box-shadow: 0 8px 24px rgba(11, 55, 100, 0.12);
	z-index: 10001;
	transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
	font-family: inherit;
}
#ksd-toast-singleton.visible { transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) {
	.ksd *, .ksd *::before, .ksd *::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}

/* ============================================================
   Kohezion - TimeControl hour dropdown: business-hours window
   The .k-hour-action / .k-hour-legacy classes are added at runtime
   by TimeControl.wireHourActionHandler on select2:open, after
   looking at each result's underlying <option data-k-*> attribute
   (Select2 does not propagate option attributes to the rendered
   <li> by default).
   ============================================================ */
/* Action row renders as a small centred chevron icon (its contents are
   injected by wireHourActionHandler). Popup keeps the hour dropdown's
   native width. */
.select2-results__option.k-hour-action {
	padding: 4px 6px;
	background: #fafbfc;
	border-top: 1px solid #eef0f2;
	cursor: pointer;
	text-align: center;
	line-height: 1;
}
.select2-results__option.k-hour-action[aria-selected="true"] {
	background: #fafbfc;
	color: #249ef5;
}
.select2-results__option--highlighted.k-hour-action,
.select2-results__option--highlighted[aria-selected].k-hour-action {
	background: #eef5fd;
	color: #0b7fd4;
}
.select2-results__option.k-hour-legacy {
	color: #b45309;
}
.select2-results__option.k-hour-legacy::before {
	content: "\26A0\FE0F";
	margin-right: 6px;
	font-size: 10px;
}
.select2-results__option--highlighted.k-hour-legacy,
.select2-results__option--highlighted[aria-selected].k-hour-legacy {
	background: #fef3c7;
	color: #92400e;
}

/* ============================================================
   Kohezion - TimeControl narrow-dropdown padding trim
   The hour / minute / seconds / AM-PM sub-dropdowns of TimeControl
   sit in ~42px wide boxes. Select2's default padding reserves 8px
   on the left and 20px on the right for the chevron, leaving only
   ~13px of text slot - too tight for the "HH" / "MM" placeholders
   (Roboto 13px capital H is ~8.5px wide, "HH" = ~17px).

   This trim is exclusive to TimeControl (matches .CoreTime.Dropdown
   which every hour/minute/seconds/amPm sub-dropdown carries - see
   time_control.js addClassName("CoreTime") applied on each sub-
   dropdown). Every other Select2 single-select in the app keeps
   its default padding untouched.
   ============================================================ */
.CoreTime.Dropdown .select2-container--default .select2-selection--single .select2-selection__rendered {
	padding-left: 4px;
	padding-right: 14px;
}
.CoreTime.Dropdown .select2-container--default .select2-selection--single .select2-selection__arrow {
	right: 2px;
	width: 12px;
	height: 23.5px;
	top: 0;
}

/* Height parity with the sibling DateControl <input>. The date input uses
   box-sizing: content-box with inline height:22px and a ~0.77px border,
   giving a total outer height of ~23.54px. Select2's default selection uses
   box-sizing: border-box with height:24px (border included), giving 24px
   outer - ~0.5px taller, which at the user's 1.3x DPR snaps to 1 physical
   pixel extra. Switch the time-control selection to content-box + 22px so
   its outer (22 + 2*0.77 = 23.54px) matches the date input exactly.
   Line-height reduced from 24 to 22 to keep the number vertically centred
   in the new content box.
   !important is required: Dropdown.setHeight(24) writes an inline style
   attribute on m_htmlDiv (height:24px) that would otherwise beat this
   stylesheet rule. */
.CoreTime.Dropdown {
	height: 23.5px !important;
}
.CoreTime.Dropdown .select2-container--default .select2-selection--single {
	box-sizing: content-box;
	height: 22px;
}
.CoreTime.Dropdown .select2-selection__rendered {
	line-height: 22px;
}

/* =========================================================================
   DocumentAssociationControl (.kasc) - additive overrides + new pieces
   that the redesigned association widget pulls in. All rules are scoped to
   .ksd.kasc so SortedDropdown-only widgets (mode-combo lists etc.) are
   untouched. Mirrors the prototype WebRoot/association_control_redesign.html
   1:1 - changes here are usually mirrored there as well.
   ========================================================================= */

/* Two panes only - drop the SortedDropdown center button column.
   Add an explicit 8px column gap (the parent rule sets gap: 0) so the two
   panes don't visually touch (user requirement: minimum 2px between boxes). */
.ksd.kasc .ksd-grid { grid-template-columns: 1fr 1fr; gap: 8px; }

/* Header overflow safety net: at extreme narrow widths where the wider kasc
   actions row (filter dropdown + 3 mini-btns) cannot fit even after the
   container queries hide the rightmost icons, clip rather than overlap. */
.ksd.kasc .ksd-pane-header { overflow: hidden; }

/* Sections (top WITH/ASSIGNED, bottom WITHOUT/NOT-ASSIGNED) - both panes. */
.ksd.kasc .ksd-section { display: block; }
.ksd.kasc .ksd-section.empty { display: none; }
.ksd.kasc .ksd-section-header {
	display: flex; align-items: center; gap: 6px;
	padding: 10px 10px 4px 10px;
	font-size: 10px; font-weight: 700;
	text-transform: uppercase; letter-spacing: 0.06em;
	color: #8C9BB5;
}
.ksd.kasc .ksd-section + .ksd-section .ksd-section-header {
	margin-top: 4px; padding-top: 10px;
	border-top: 1px dashed #E5E7EB;
}
.ksd-section-count {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 16px; height: 14px; padding: 0 5px;
	background: #EBF2F8; color: #0B3764;
	font-size: 9px; font-weight: 700; border-radius: 999px;
}

/* Indicators on left-pane rows that have at least one association. */
.ksd-assoc-dot {
	display: none;
	width: 8px; height: 8px; border-radius: 50%;
	background: #FF9500; flex-shrink: 0;
	box-shadow: 0 0 0 1px rgba( 255, 149, 0, 0.25 );
}
.ksd-assoc-badge {
	display: none; align-items: center; gap: 4px;
	padding: 1px 7px; background: #FFF4E0; color: #B45309;
	border: 1px solid #FFE0B2; border-radius: 999px;
	font-size: 11px; font-weight: 700; flex-shrink: 0; margin-left: auto;
	line-height: 16px;
}
.ksd-assoc-badge svg { width: 10px; height: 10px; fill: currentColor; }
.ksd.kasc [data-side="a"] .ksd-item.has-assoc .ksd-assoc-dot { display: block; }
.ksd.kasc [data-side="a"] .ksd-item.has-assoc .ksd-assoc-badge { display: inline-flex; }

/* 3-state filter pills in the left-pane header (All / With / Without). */
.ksd-filter-segmented {
	display: inline-flex; align-items: center;
	height: 26px; padding: 2px;
	border: 1px solid #DEE0E3; background: #FFFFFF;
	border-radius: 999px; gap: 1px;
}
.ksd-filter-segmented button {
	border: none; background: transparent; color: #6b7280;
	padding: 0 10px; height: 100%;
	font-family: inherit; font-size: 11px; font-weight: 600;
	cursor: pointer; border-radius: 999px;
	transition: all 180ms cubic-bezier( 0.4, 0, 0.2, 1 );
	display: inline-flex; align-items: center; white-space: nowrap;
}
.ksd-filter-segmented button:hover:not(.active) {
	background: #f3f4f6; color: #0B3764;
}
.ksd-filter-segmented button.active {
	background: #FFF4E0; color: #B45309;
}
.ksd-filter-segmented .seg-num {
	opacity: 0.65; font-weight: 500; margin-left: 5px; font-size: 10.5px;
}
.ksd-filter-segmented button.active .seg-num { opacity: 1; }

/* Native <select> fallback for narrow widths.
   Selector is `select.ksd-filter-dropdown` (not just `.ksd-filter-dropdown`) so
   specificity (0,1,1) beats the global `select:not([multiple])` rule in
   styles_k.css which would otherwise win the cascade and overwrite our chevron
   background-image, background-position, and padding with its own (broken)
   values. */
select.ksd-filter-dropdown {
	display: none;
	height: 26px; padding: 0 24px 0 10px !important;
	border: 1px solid #DEE0E3; background-color: #FFFFFF;
	background-image: url( "data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z' fill='%236b7280'/%3E%3C/svg%3E" );
	background-repeat: no-repeat;
	background-position-x: calc( 100% - 8px );
	background-position-y: 50%;
	background-size: 14px 14px;
	color: #6b7280; border-radius: 999px;
	font-family: inherit; font-size: 11px; font-weight: 600; cursor: pointer;
	-webkit-appearance: none; -moz-appearance: none; appearance: none; outline: none;
}
select.ksd-filter-dropdown.active {
	background-color: #FFF4E0; border-color: #FFE0B2; color: #B45309;
}

/* Filter modes - hide the section that does not match. */
.ksd.filter-with-only [data-side="a"] .ksd-section-without { display: none; }
.ksd.filter-without-only [data-side="a"] .ksd-section-with { display: none; }

/* Container query: the pane is the container, swap pills for dropdown
   when it's too narrow to comfortably show All / With / Without. */
.ksd.kasc .ksd-pane { container-type: inline-size; container-name: kasc-pane; }
@container kasc-pane ( max-width: 420px ) {
	.ksd.kasc .ksd-filter-segmented { display: none; }
	.ksd.kasc select.ksd-filter-dropdown { display: inline-block; }
}

/* Kasc AVAILABLE pane has a wider actions row (filter dropdown + 3 mini-btns)
   than the base SortedDropdown, so hide rightmost actions earlier. SELECTED
   side uses the universal breakpoints from the base section. */
@container kasc-pane ( max-width: 225px ) {
	.ksd.kasc .ksd-pane[data-side="a"] .ksd-pane-header > .ksd-header-actions > *:nth-last-child(-n+1) { display: none; }
}
@container kasc-pane ( max-width: 195px ) {
	.ksd.kasc .ksd-pane[data-side="a"] .ksd-pane-header > .ksd-header-actions > *:nth-last-child(-n+2) { display: none; }
}
@container kasc-pane ( max-width: 170px ) {
	.ksd.kasc .ksd-pane[data-side="a"] .ksd-pane-header > .ksd-header-actions > *:nth-last-child(-n+3) { display: none; }
}
@container kasc-pane ( max-width: 140px ) {
	.ksd.kasc .ksd-pane[data-side="a"] .ksd-pane-header > .ksd-header-actions > *:nth-last-child(-n+4) { display: none; }
}

/* Clear-X inside the search input (only shown when input has text). */
.ksd-search-clear {
	display: none;
	position: absolute; right: 18px; top: 50%; transform: translateY( -50% );
	width: 18px; height: 18px;
	border: none; background: #DEE0E3; color: #FFFFFF;
	border-radius: 50%; cursor: pointer; padding: 0;
	align-items: center; justify-content: center;
	transition: background 120ms;
}
.ksd-search-clear svg { width: 10px; height: 10px; fill: currentColor; display: block; }
.ksd-search-clear:hover { background: #A0AEC0; }
.ksd-search.has-text .ksd-search-clear { display: inline-flex; }
