/* Record selection reuses the shared dialog, overview table and native choice controls. */
.selection-dialog { width: min(680px, calc(100% - 32px)); max-height: calc(100dvh - 32px); color: var(--text); }
.selection-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
.selection-dialog [hidden] { display: none !important; }
.selection-dialog > :not(.selection-dialog__results) { flex-shrink: 0; }
.selection-dialog header p { font-weight: 400; }
.selection-dialog__search { padding: 12px var(--interface-card-padding); }
.selection-dialog .selection-dialog__search label { display: block; margin-bottom: 5px; font-size: var(--interface-label-size); font-weight: 700; }
.selection-dialog .selection-dialog__search input { width: 100%; min-height: var(--interface-control-height); padding: var(--interface-control-padding); font-size: var(--interface-value-size); }

/* Scroll results independently so the search and confirmation stay reachable. */
.selection-dialog__results { min-height: 48px; max-height: 320px; overflow: auto; overscroll-behavior: contain; }
.app-main .selection-dialog__results > .overview-table { width: 100%; min-width: 500px; table-layout: fixed; }
.selection-dialog__results th { position: sticky; top: 0; z-index: 1; background: var(--table-header-surface); }
.selection-dialog__results .selection-dialog__select { width: 40px; }
.selection-dialog__results tbody tr { cursor: pointer; }
.selection-dialog__results tbody tr:hover { background: color-mix(in srgb, var(--link) 3%, transparent); }
.selection-dialog__results tr:has(input:checked) { background: var(--hover-surface); }
.selection-dialog__results tr:has(input:focus-visible) { outline: 2px solid var(--link); outline-offset: -2px; }
.selection-dialog__copy { text-align: left; }
.selection-dialog__copy strong,
.selection-dialog__copy span,
.selection-dialog__copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.25; }
.selection-dialog__copy strong { color: var(--link); }
.selection-dialog__copy span,
.selection-dialog__copy small { font-weight: 450; }

/* Quiet guidance and shared action sizing keep the footer compact on every viewport. */
.selection-dialog__feedback { margin: 0; padding: 10px var(--interface-card-padding); color: var(--muted); font-size: var(--interface-helper-size); line-height: 1.5; }
.selection-dialog [role="alert"] { color: var(--danger); }
.selection-dialog footer { padding: 12px var(--interface-card-padding); border-top: 1px solid var(--border); background: var(--surface-subtle); }

/* Selection controls retain the central native geometry inside ordinary editor forms. */
.selection-dialog__results td label { display: flex; margin: 0; align-items: center; cursor: pointer; }
.selection-dialog__results input[type="checkbox"] { width: 20px; height: 20px; min-height: 20px; padding: 0; margin: 0; flex: 0 0 20px; }
.selection-dialog__results td:last-child { overflow: hidden; text-overflow: ellipsis; }
